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

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

Issue 18197003: Report MAP_VALUE_TYPE_NOT_ASSIGNABLE warning/error. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix for comment Created 7 years, 5 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/StaticWarningCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
index c2b58071ea75d6745021748e5e460d44e69d7259..d1d3dae4c5137d8e5ba4f429150459031a9a5fad 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
@@ -1205,6 +1205,22 @@ public class StaticWarningCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_mapKeyTypeNotAssignable() throws Exception {
+ Source source = addSource(createSource(//
+ "var v = <String, int > {1 : 2};"));
+ resolve(source);
+ assertErrors(StaticWarningCode.MAP_KEY_TYPE_NOT_ASSIGNABLE);
+ verify(source);
+ }
+
+ public void test_mapValueTypeNotAssignable() throws Exception {
+ Source source = addSource(createSource(//
+ "var v = <String, String> {'a' : 2};"));
+ resolve(source);
+ assertErrors(StaticWarningCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE);
+ verify(source);
+ }
+
public void test_mismatchedAccessorTypes_class() throws Exception {
Source source = addSource(createSource(//
"class A {",

Powered by Google App Engine
This is Rietveld 408576698