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

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

Issue 26582002: Report CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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/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 79b11be0a9e43703497a6db482bc4d0088cf6906..37a8f3ee5bb3e354fe032b89348b0cc62fddcde4 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
@@ -556,6 +556,37 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_constMapKeyTypeImplementsEquals_direct() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " const A();",
+ " operator ==(other) => false;",
+ "}",
+ "main() {",
+ " const {const A() : 0};",
+ "}"));
+ resolve(source);
+ assertErrors(source, CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS);
+ verify(source);
+ }
+
+ public void test_constMapKeyTypeImplementsEquals_super() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " const A();",
+ " operator ==(other) => false;",
+ "}",
+ "class B extends A {",
+ " const B();",
+ "}",
+ "main() {",
+ " const {const B() : 0};",
+ "}"));
+ resolve(source);
+ assertErrors(source, CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS);
+ verify(source);
+ }
+
public void test_constWithInvalidTypeParameters() throws Exception {
Source source = addSource(createSource(//
"class A {",

Powered by Google App Engine
This is Rietveld 408576698