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

Unified Diff: tests/language/const_syntax_test.dart

Issue 1259813003: Fix #23871: identical on consts should be always const (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: comment Created 5 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
« no previous file with comments | « runtime/vm/ast.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/const_syntax_test.dart
diff --git a/tests/language/const_syntax_test.dart b/tests/language/const_syntax_test.dart
index 668bb9f96ff982fba1834f18818336890c4038d8..ff231674048f5d9d6696dced9bc1f0895082a010 100644
--- a/tests/language/const_syntax_test.dart
+++ b/tests/language/const_syntax_test.dart
@@ -32,6 +32,13 @@ main() {
Expect.equals("Hello 42", B2);
Expect.equals("42Hello", B3); /// 10: compile-time error
+
+ const cf1 = identical(const Point(1, 2), const Point(1, 2));
+
+ const cf2 = identical(const Point(1, 2), new Point(1, 2)); /// 11: compile-time error
+
+ var f4 = B4; /// 12: compile-time error
+ var f5 = B5;
}
const F0 = 42;
@@ -75,3 +82,8 @@ const B0 = 42;
const B1 = "Hello";
const B2 = "$B1 $B0";
const B3 = B0 + B1; /// 10: continued
+
+// Check identical.
+
+const B4 = identical(1, new Point(1,2));
+const B5 = identical(1, const Point(1,2));
« no previous file with comments | « runtime/vm/ast.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698