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

Unified Diff: pkg/analyzer/test/src/summary/summary_common.dart

Issue 1835313002: Fix AST summarization when there are explicit calls to super constructors. (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/lib/src/summary/link.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/summary/summary_common.dart
diff --git a/pkg/analyzer/test/src/summary/summary_common.dart b/pkg/analyzer/test/src/summary/summary_common.dart
index 181376cc4c6665d31f92b06a1e255d9d885673be..69a1d295c424971e0a872a0f8b9155fe95318228 100644
--- a/pkg/analyzer/test/src/summary/summary_common.dart
+++ b/pkg/analyzer/test/src/summary/summary_common.dart
@@ -4050,6 +4050,42 @@ class C extends E {
checkConstCycle('C', hasCycle: false);
}
+ test_constructorCycle_viaSupertype_explicit() {
+ serializeLibraryText('''
+class C {
+ final x;
+ const C() : x = const D();
+ const C.named() : x = const D.named();
+}
+class D extends C {
+ const D() : super();
+ const D.named() : super.named();
+}
+''');
+ checkConstCycle('C');
+ checkConstCycle('C', name: 'named');
+ checkConstCycle('D');
+ checkConstCycle('D', name: 'named');
+ }
+
+ test_constructorCycle_viaSupertype_explicit_undefined() {
+ // It's not valid Dart but we need to make sure it doesn't crash
+ // summary generation.
+ serializeLibraryText(
+ '''
+class C {
+ final x;
+ const C() : x = const D();
+}
+class D extends C {
+ const D() : super.named();
+}
+''',
+ allowErrors: true);
+ checkConstCycle('C', hasCycle: false);
+ checkConstCycle('D', hasCycle: false);
+ }
+
test_constructorCycle_viaSupertype_withDefaultTypeArgument() {
serializeLibraryText('''
class C<T> {
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698