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

Unified Diff: compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.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/resolver/ResolverTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java b/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
index c8342351e8975ae28ab8f04ab1fa8e5332ed3b0a..a858fb5e28ed80c9eb9dd9322612a1651c8bfa42 100644
--- a/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
+++ b/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
@@ -971,15 +971,32 @@ public class ResolverTest extends ResolverTestCase {
public void test_noSuchType_mapLiteral_typeArgument() throws Exception {
resolveAndTest(Joiner.on("\n").join(
"class Object {}",
+ "class String {}",
"class MyClass {",
" foo() {",
" var map = <T>{};",
" }",
"}"),
- ResolverErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS,
ResolverErrorCode.NO_SUCH_TYPE);
}
+ public void test_noSuchType_mapLiteral_num_type_args() throws Exception {
+ resolveAndTest(Joiner.on("\n").join(
+ "class Object {}",
+ "interface int {}",
+ "interface String {}",
+ "class MyClass {",
+ " foo() {",
+ " var map0 = {};",
+ " var map1 = <int>{'foo': 1};",
+ " var map2 = <String, int>{'foo' : 1};",
+ " var map3 = <String, int, int>{'foo' : 1};",
+ " }",
+ "}"),
+ ResolverErrorCode.DEPRECATED_MAP_LITERAL_SYNTAX,
+ ResolverErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS);
+ }
+
public void test_noSuchType_arrayLiteral_typeArgument() throws Exception {
resolveAndTest(Joiner.on("\n").join(
"class Object {}",

Powered by Google App Engine
This is Rietveld 408576698