File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
lib/src/services/correction Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1444,6 +1444,12 @@ class AssistProcessor {
1444
1444
_coverageMarker ();
1445
1445
return ;
1446
1446
}
1447
+ // ignore if an incomplete variable declaration
1448
+ if (declarationList.variables.length == 1 &&
1449
+ declarationList.variables[0 ].name.isSynthetic) {
1450
+ _coverageMarker ();
1451
+ return ;
1452
+ }
1447
1453
// must be not after the name of the variable
1448
1454
VariableDeclaration firstVariable = declarationList.variables[0 ];
1449
1455
if (selectionOffset > firstVariable.name.end) {
Original file line number Diff line number Diff line change @@ -3317,6 +3317,14 @@ main() {
3317
3317
''' );
3318
3318
}
3319
3319
3320
+ test_removeTypeAnnotation_topLevelVariable_BAD_syntheticName () async {
3321
+ verifyNoTestUnitErrors = false ;
3322
+ resolveTestUnit ('''
3323
+ MyType
3324
+ ''' );
3325
+ await assertNoAssistAt ('MyType' , DartAssistKind .REMOVE_TYPE_ANNOTATION );
3326
+ }
3327
+
3320
3328
test_removeTypeAnnotation_topLevelVariable_OK () async {
3321
3329
resolveTestUnit ('''
3322
3330
int V = 1;
You can’t perform that action at this time.
0 commit comments