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

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

Issue 1841283002: When building summaries from ASTs, handle circularities involving .length. (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 a8dde28e7783bbb411871174cbc83362c16bb26c..e961d784e75eea54eda54797e2bd70a26a2e66e3 100644
--- a/pkg/analyzer/test/src/summary/summary_common.dart
+++ b/pkg/analyzer/test/src/summary/summary_common.dart
@@ -4179,6 +4179,21 @@ class C {
checkConstCycle('C');
}
+ test_constructorCycle_viaLength() {
+ // 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 = y.length;
+}
+const y = const C();
+''',
+ allowErrors: true);
+ checkConstCycle('C');
+ }
+
test_constructorCycle_viaNamedConstructor() {
serializeLibraryText('''
class C {
« 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