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

Unified Diff: tests/language/regress_27164_test.dart

Issue 2300113002: Ensure that constant field initializers are canonicalized (Closed)
Patch Set: wip Created 4 years, 3 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/parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/regress_27164_test.dart
diff --git a/pkg/dev_compiler/test/codegen/language/static_field_override2_test.dart b/tests/language/regress_27164_test.dart
similarity index 51%
copy from pkg/dev_compiler/test/codegen/language/static_field_override2_test.dart
copy to tests/language/regress_27164_test.dart
index 7942c35d74f9d3922e1139fbc3f3d25692c8299d..6f4513f5004ad5664a58c84331c884ae8c8a6887 100644
--- a/pkg/dev_compiler/test/codegen/language/static_field_override2_test.dart
+++ b/tests/language/regress_27164_test.dart
@@ -2,17 +2,19 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// Regression test for issue 27164.
+
import 'package:expect/expect.dart';
-class Foo {
- static int get x => 42;
- static void set x(value) {}
-}
+String simpleEcho(String arg) => arg;
-class Bar extends Foo {
- static int x = 12;
+class Echo {
+ final echo;
+ // Check that the expression simpleEcho is a compile-time constant.
+ const Echo() : echo = simpleEcho;
}
void main() {
- Expect.equals(12, Bar.x);
-}
+ Expect.equals("hello", const Echo().echo("hello"));
+}
+
« no previous file with comments | « runtime/vm/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698