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

Unified Diff: pkg/analyzer/test/generated/non_error_resolver_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
Index: pkg/analyzer/test/generated/non_error_resolver_test.dart
diff --git a/pkg/analyzer/test/generated/non_error_resolver_test.dart b/pkg/analyzer/test/generated/non_error_resolver_test.dart
index 292d0161690791627fe8be7daac221759da841cb..fd3a4229cf269b9249b6dedb4887c4d933f2318e 100644
--- a/pkg/analyzer/test/generated/non_error_resolver_test.dart
+++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart
@@ -1477,6 +1477,26 @@ main() {
verify([source]);
}
+ void test_constRedirectSkipsSupertype() {
+ // Since C redirects to C.named, it doesn't implicitly refer to B's
+ // unnamed constructor. Therefore there is no cycle.
+ Source source = addSource('''
+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();
+''');
+ computeLibrarySourceErrors(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
void test_constructorDeclaration_scope_signature() {
Source source = addSource(r'''
const app = 0;
« no previous file with comments | « pkg/analyzer/lib/src/dart/constant/evaluation.dart ('k') | tests/language/const_redirect_skips_supertype_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698