Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Unified Diff: pkg/compiler/lib/src/parser/element_listener.dart

Issue 2750863002: Complain about built-in identifiers. (Closed)
Patch Set: Address comments. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/parser/error_kind.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/parser/element_listener.dart
diff --git a/pkg/compiler/lib/src/parser/element_listener.dart b/pkg/compiler/lib/src/parser/element_listener.dart
index 0925a1c5ca100c04b4d61bd01d4bf6eeea05e0c6..777ab85a746261054ae6828a52e0adb0f10201c6 100644
--- a/pkg/compiler/lib/src/parser/element_listener.dart
+++ b/pkg/compiler/lib/src/parser/element_listener.dart
@@ -717,6 +717,16 @@ class ElementListener extends Listener {
case ErrorKind.Unspecified:
errorCode = MessageKind.GENERIC;
break;
+
+ case ErrorKind.BuiltInIdentifierAsType:
+ errorCode = MessageKind.GENERIC;
+ arguments = {"text": "Can't use '${token.lexeme}' as a type."};
+ break;
+
+ case ErrorKind.BuiltInIdentifierInDeclaration:
+ errorCode = MessageKind.GENERIC;
+ arguments = {"text": "Can't use '${token.lexeme}' as a name here."};
+ break;
}
SourceSpan span = reporter.spanFromToken(token);
reportError(span, errorCode, arguments);
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/parser/error_kind.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698