Index: pkg/analyzer/lib/src/fasta/ast_builder.dart |
diff --git a/pkg/analyzer/lib/src/fasta/ast_builder.dart b/pkg/analyzer/lib/src/fasta/ast_builder.dart |
index 38d9d584da69ec9d1298057762949d7df99af973..b3896c96a8727f1d38e1b56e7093a83ddf815c77 100644 |
--- a/pkg/analyzer/lib/src/fasta/ast_builder.dart |
+++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart |
@@ -18,7 +18,11 @@ import 'package:front_end/src/scanner/token.dart' as analyzer; |
import 'package:front_end/src/fasta/errors.dart' show internalError; |
import 'package:front_end/src/fasta/fasta_codes.dart' |
- show FastaMessage, codeExpectedExpression, codeExpectedFunctionBody; |
+ show |
+ FastaCode, |
+ FastaMessage, |
+ codeExpectedExpression, |
+ codeExpectedFunctionBody; |
import 'package:front_end/src/fasta/kernel/kernel_builder.dart' |
show Builder, KernelLibraryBuilder, ProcedureBuilder, Scope; |
import 'package:front_end/src/fasta/parser/identifier_context.dart' |
@@ -1918,6 +1922,15 @@ class AstBuilder extends ScopeListener { |
@override |
void addCompileTimeErrorFromMessage(FastaMessage message) { |
+ FastaCode code = message.code; |
+ switch (code.analyzerCode) { |
+ case "EXPECTED_TYPE_NAME": |
+ errorReporter?.reportErrorForOffset( |
+ ParserErrorCode.EXPECTED_TYPE_NAME, message.charOffset, 1); |
+ return; |
+ default: |
+ // fall through |
+ } |
library.addCompileTimeError(message.charOffset, message.message, |
fileUri: message.uri); |
} |