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

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

Issue 22812017: Don't report an error when Map key type is not String. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 4e2304137312d51d7a1d3fb43ec72de0fb9ae228..fe5ea4c1aa543404f78a87e1d7e657b438fdbde3 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
@@ -726,7 +726,6 @@ public class ErrorVerifier extends RecursiveASTVisitor<Void> {
if (typeArguments != null) {
NodeList<TypeName> arguments = typeArguments.getArguments();
if (arguments.size() != 0) {
- checkForInvalidTypeArgumentForKey(arguments);
if (node.getConstKeyword() != null) {
checkForInvalidTypeArgumentInConstTypedLiteral(
arguments,
@@ -3305,24 +3304,6 @@ public class ErrorVerifier extends RecursiveASTVisitor<Void> {
}
/**
- * Checks to ensure that first type argument to a map literal must be the 'String' type.
- *
- * @param arguments a non-{@code null}, non-empty {@link TypeName} node list from the respective
- * {@link MapLiteral}
- * @return {@code true} if and only if an error code is generated on the passed node
- * @see CompileTimeErrorCode#INVALID_TYPE_ARGUMENT_FOR_KEY
- */
- private boolean checkForInvalidTypeArgumentForKey(NodeList<TypeName> arguments) {
- TypeName firstArgument = arguments.get(0);
- Type firstArgumentType = firstArgument.getType();
- if (firstArgumentType != null && !firstArgumentType.equals(typeProvider.getStringType())) {
- errorReporter.reportError(CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_FOR_KEY, firstArgument);
- return true;
- }
- return false;
- }
-
- /**
* Checks to ensure that the passed {@link ListLiteral} or {@link MapLiteral} does not have a type
* parameter as a type argument.
*

Powered by Google App Engine
This is Rietveld 408576698