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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.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/CompileTimeErrorCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
index 8e98db7bb3d653c68397c7fa226dec6458c7d2a2..c1dda081570f16841f79eca7ada7ce7b03ad0559 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
@@ -2055,6 +2055,22 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_mapKeyTypeNotAssignable() throws Exception {
+ Source source = addSource(createSource(//
+ "var v = const <String, int > {1 : 2};"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE);
+ verify(source);
+ }
+
+ public void test_mapValueTypeNotAssignable() throws Exception {
+ Source source = addSource(createSource(//
+ "var v = const <String, String> {'a' : 2};"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE);
+ verify(source);
+ }
+
public void test_memberWithClassName_field() throws Exception {
Source source = addSource(createSource(//
"class A {",

Powered by Google App Engine
This is Rietveld 408576698