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

Unified Diff: tests/language/const_map3_test.dart

Issue 267923004: Check const map literal keys and switch case exprs using type of constant. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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: tests/language/const_map3_test.dart
diff --git a/tests/language/const_map2_test.dart b/tests/language/const_map3_test.dart
similarity index 85%
copy from tests/language/const_map2_test.dart
copy to tests/language/const_map3_test.dart
index 6b599f70d1585a34903a5c6bf1f136c9197123f4..730cb013750a403dbbb3fe17e982bc46a704b394 100644
--- a/tests/language/const_map2_test.dart
+++ b/tests/language/const_map3_test.dart
@@ -5,7 +5,7 @@
import "package:expect/expect.dart";
class A {
- const factory A() = B;
+ static const b = const B();
}
class B implements A {
@@ -21,9 +21,9 @@ confuse(x) {
main() {
// It is a compile-time error if the key type overrides operator ==.
- var m = const { const A(): 42 };
+ var m = const { A.b: 42 };
Expect.equals(42, m[confuse(const B())]);
- m = const { "foo": 99, const A(): 499 };
+ m = const { "foo": 99, A.b: 499 };
Expect.equals(499, m[confuse(const B())]);
}

Powered by Google App Engine
This is Rietveld 408576698