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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java

Issue 25505006: Report BUILT_IN_IDENTIFIER_AS_TYPE for formal parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Report BUILT_IN_IDENTIFIER_AS_TYPE in type resolver. Created 7 years, 2 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: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
index f861b85b4d3ed1dcc547f125b23eb12599cf4a11..89e16bf98a73ebaffe5888cfd66c63aad3840d8d 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
@@ -963,7 +963,6 @@ public class ErrorVerifier extends RecursiveASTVisitor<Void> {
@Override
public Void visitVariableDeclarationList(VariableDeclarationList node) {
- checkForBuiltInIdentifierAsName(node);
return super.visitVariableDeclarationList(node);
}
@@ -1911,34 +1910,6 @@ public class ErrorVerifier extends RecursiveASTVisitor<Void> {
}
/**
- * This verifies that the passed variable declaration list does not have a built-in identifier.
- *
- * @param node the variable declaration list to check
- * @return {@code true} if and only if an error code is generated on the passed node
- * @see CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPE
- */
- private boolean checkForBuiltInIdentifierAsName(VariableDeclarationList node) {
- TypeName typeName = node.getType();
- if (typeName != null) {
- Identifier identifier = typeName.getName();
- if (identifier instanceof SimpleIdentifier) {
- SimpleIdentifier simpleIdentifier = (SimpleIdentifier) identifier;
- Token token = simpleIdentifier.getToken();
- if (token.getType() == TokenType.KEYWORD) {
- if (((KeywordToken) token).getKeyword() != Keyword.DYNAMIC) {
- errorReporter.reportError(
- CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE,
- identifier,
- identifier.getName());
- return true;
- }
- }
- }
- }
- return false;
- }
-
- /**
* This verifies that the given switch case is terminated with 'break', 'continue', 'return' or
* 'throw'.
*

Powered by Google App Engine
This is Rietveld 408576698