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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticTypeWarningCodeTest.java

Issue 27179004: Issue 12103. It is warning to provide wrong number of type arguments for list/map literals. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Non-error tests. Created 7 years, 2 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_test/src/com/google/dart/engine/resolver/StaticTypeWarningCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticTypeWarningCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticTypeWarningCodeTest.java
index 28b2352c9dd5ff2971d754e44bf9a13fbdcf47f2..910fae9ec60e4c7932ac347ca44235a023b93655 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticTypeWarningCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticTypeWarningCodeTest.java
@@ -26,6 +26,36 @@ public class StaticTypeWarningCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_expectedOneListTypeArgument() throws Exception {
+ Source source = addSource(createSource(//
+ "main() {",
+ " <int, int> [];",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticTypeWarningCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS);
+ verify(source);
+ }
+
+ public void test_expectedTwoMapTypeArguments_one() throws Exception {
+ Source source = addSource(createSource(//
+ "main() {",
+ " <int> {};",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticTypeWarningCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS);
+ verify(source);
+ }
+
+ public void test_expectedTwoMapTypeArguments_three() throws Exception {
+ Source source = addSource(createSource(//
+ "main() {",
+ " <int, int, int> {};",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticTypeWarningCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS);
+ verify(source);
+ }
+
public void test_inconsistentMethodInheritance_paramCount() throws Exception {
Source source = addSource(createSource(//
"abstract class A {",

Powered by Google App Engine
This is Rietveld 408576698