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

Unified Diff: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.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/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
index 2de3844c10e82e505142b7fb418b6991373cc0df..35cdffa638426926047300ad4541a49b1220888f 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
@@ -715,25 +715,25 @@ public class TypeAnalyzerTest extends TypeAnalyzerTestCase {
public void testMapLiteral() {
analyze("{ var x = {\"key\": 42}; }");
analyze("{ var x = {'key': 42}; }");
- analyze("{ var x = <String, num>{'key': 42}; }");
- analyze("{ var x = <String, int>{'key': 42}; }");
- analyze("{ var x = <String, num>{'key': 0.42}; }");
- analyze("{ var x = <Object, num>{'key': 42}; }");
- analyzeFail("{ var x = <String, int>{'key': 0.42}; }",
+ analyze("{ var x = <num>{'key': 42}; }");
+ analyze("{ var x = <int>{'key': 42}; }");
+ analyze("{ var x = <num>{'key': 0.42}; }");
+ analyze("{ var x = <num>{'key': 42}; }");
+ analyzeFail("{ var x = <int>{'key': 0.42}; }",
TypeErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE);
analyzeFail("{ int i; var x = {'key': i = 0.42}; }",
TypeErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE);
analyze("{ var x = const {\"key\": 42}; }");
analyze("{ var x = const {'key': 42}; }");
- analyze("{ var x = const <String, num>{'key': 42}; }");
- analyze("{ var x = const <String, int>{'key': 42}; }");
- analyze("{ var x = const <String, num>{'key': 0.42}; }");
- analyze("{ var x = const <Object, num>{'key': 42}; }");
- analyzeFail("{ var x = const <String, int>{'key': 0.42}; }",
+ analyze("{ var x = const <num>{'key': 42}; }");
+ analyze("{ var x = const <int>{'key': 42}; }");
+ analyze("{ var x = const <num>{'key': 0.42}; }");
+ analyze("{ var x = const <num>{'key': 42}; }");
+ analyzeFail("{ var x = const <int>{'key': 0.42}; }",
TypeErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE);
analyzeFail("{ int i; var x = const {'key': i = 0.42}; }",
TypeErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE);
- analyzeFail("{var x = const <num, num>{}; }",
+ analyzeFail("{Map<num, num> x = const <num>{}; }",
TypeErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE);
}

Powered by Google App Engine
This is Rietveld 408576698