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

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

Issue 10836281: Issue 4523. Analyzer should require two type arguments for map literals (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/resolver/ResolverErrorCode.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/resolver/Resolver.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/Resolver.java b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
index d3b07f439cf46c6b63a4408599f7034a2a2fb8ef..5102e705e0fef59bd5d3bf2e40e2e1d3bb64d368 100644
--- a/compiler/java/com/google/dart/compiler/resolver/Resolver.java
+++ b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
@@ -1897,15 +1897,15 @@ public class Resolver {
new DartIdentifier("String"));
switch (originalTypeArgs.size()) {
case 1:
+ // Old (pre spec 0.11) map specification
typeArgs.add(implicitKey);
- typeArgs.addAll(originalTypeArgs);
+ typeArgs.add(originalTypeArgs.get(0));
+ // TODO(scheglov) enable this warning
+// topLevelContext.onError(originalTypeArgs.get(0), ResolverErrorCode.DEPRECATED_MAP_LITERAL_SYNTAX);
break;
case 2:
- // Old (pre spec 0.6) map specification
- // TODO(zundel): remove this case after a while (added on 24 Jan 2012)
- typeArgs.add(implicitKey);
+ typeArgs.add(originalTypeArgs.get(0));
typeArgs.add(originalTypeArgs.get(1));
- topLevelContext.onError(originalTypeArgs.get(0), ResolverErrorCode.DEPRECATED_MAP_LITERAL_SYNTAX);
break;
default:
topLevelContext.onError(node, ResolverErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS,
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/resolver/ResolverErrorCode.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698