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

Unified Diff: tests/language/regress_27617_test.dart

Issue 2439593003: Add check for constness in constructor redirection (Closed)
Patch Set: Add regression test Created 4 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
« no previous file with comments | « tests/language/language_analyzer2.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/regress_27617_test.dart
diff --git a/pkg/dev_compiler/test/codegen/language/static_field_override3_test.dart b/tests/language/regress_27617_test.dart
similarity index 50%
copy from pkg/dev_compiler/test/codegen/language/static_field_override3_test.dart
copy to tests/language/regress_27617_test.dart
index a33147d67816c83f659a9c07334e0f72beeaad89..9a0fdbd9f9f21787e347ba48b45b2c431269884b 100644
--- a/pkg/dev_compiler/test/codegen/language/static_field_override3_test.dart
+++ b/tests/language/regress_27617_test.dart
@@ -2,16 +2,15 @@
// 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.
-import 'package:expect/expect.dart';
class Foo {
- static int x = 42;
-}
+ final String greeting;
+ Foo._(this.greeting) { }
-class Bar extends Foo {
- static int x = 12;
+ // Const constructor must not redirect to non-const constructor.
+ const Foo.hi() : this._('hi'); /// 1: compile-time error
}
-void main() {
- Expect.equals(12, Bar.x);
-}
+main() {
+ const h = const Foo.hi(); /// 1: continued
+}
« no previous file with comments | « tests/language/language_analyzer2.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698