| Index: pkg/analysis_server/lib/src/services/correction/fix_internal.dart
|
| diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
|
| index dbe4636640de26d28f1a6287cb0888a955c8853d..ff9dd933ed261065750f0e040bb8c51d8079f72a 100644
|
| --- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
|
| +++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
|
| @@ -835,8 +835,13 @@ class FixProcessor {
|
| SourceBuilder sb = new SourceBuilder(file, target.offset);
|
| {
|
| // append type
|
| - DartType fieldType = _inferUndefinedExpressionType(node);
|
| - _appendType(sb, fieldType, groupId: 'TYPE', orVar: true);
|
| + DartType type = _inferUndefinedExpressionType(node);
|
| + if (!(type == null ||
|
| + type is InterfaceType ||
|
| + type is FunctionType && type.element != null && !type.element.isSynthetic)) {
|
| + return;
|
| + }
|
| + _appendType(sb, type, groupId: 'TYPE', orVar: true);
|
| // append name
|
| {
|
| sb.startPosition('NAME');
|
|
|