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

Unified Diff: tests/language/const_redirect_skips_supertype_test.dart

Issue 1841523003: Fix a corner case of constant evaluation cycle detection. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 | « pkg/analyzer/test/generated/non_error_resolver_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/const_redirect_skips_supertype_test.dart
diff --git a/tests/language/const_redirect_skips_supertype_test.dart b/tests/language/const_redirect_skips_supertype_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..c84aa6227445eaf2a511049eb082c92e0fe1759b
--- /dev/null
+++ b/tests/language/const_redirect_skips_supertype_test.dart
@@ -0,0 +1,21 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+// Since C redirects to C.named, it doesn't implicitly refer to B's
+// unnamed constructor. Therefore there is no cycle.
+
+class B {
+ final x;
+ const B() : x = y;
+ const B.named() : x = null;
+}
+class C extends B {
+ const C() : this.named();
+ const C.named() : super.named();
+}
+const y = const C();
+
+main() {
+ print(y);
+}
« no previous file with comments | « pkg/analyzer/test/generated/non_error_resolver_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698