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

Unified Diff: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java

Issue 9235015: Update map literal syntax to expect only one type parameter (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 11 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/type/TypeAnalyzer.java
diff --git a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
index c3151530f65bd9c55b207c7a51a1ee61ef4edc09..cf963c6207ba507784a40386b5b8e81645010b73 100644
--- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
+++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
@@ -1026,8 +1026,8 @@ public class TypeAnalyzer implements DartCompilationPhase {
visit(node.getTypeArguments());
InterfaceType type = node.getType();
- // This ensures that the declared type is assignable to Map<String, dynamic>.
- // For example, the user should not write Map<int,int>.
+ // The Map literal has an implicit key type of String, so only one parameter is
+ // specified <V> where V is the type of the value.
checkAssignable(node, type, defaultLiteralMapType);
Type valueType = type.getArguments().get(1);

Powered by Google App Engine
This is Rietveld 408576698