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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java

Issue 10542094: Issue 3477. Report error when built-in identifier used as type name (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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
Index: compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java b/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
index 9efd3dacc772808896c28a43a95102632fe9459b..1c933dd22ada292a50cc0b624da5ecac52491361 100644
--- a/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
+++ b/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
@@ -219,7 +219,7 @@ public class ResolutionContext implements ResolutionErrorListener {
// Built-in identifier can not be used as a type annotation.
if (identifier instanceof DartIdentifier) {
String name = ((DartIdentifier) identifier).getName();
- if (DartParser.PSEUDO_KEYWORDS_SET.contains(name)) {
+ if (DartParser.PSEUDO_KEYWORDS_SET.contains(name) && !"Dynamic".equals(name)) {
onError(identifier, ResolverErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE, name);
return Types.newDynamicType();
}

Powered by Google App Engine
This is Rietveld 408576698