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

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

Issue 1762663002: Add support for ConstructorElementImpl.isCycleFree to summaries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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/src/summary/resynthesize_test.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 9427cd62ae5e96dcc9b4fc751217b5f535393275..a90342c400bfe5ca9fe534ad0f3543d00ce8f788 100644
--- a/pkg/analyzer/test/src/summary/summary_common.dart
+++ b/pkg/analyzer/test/src/summary/summary_common.dart
@@ -3800,6 +3800,49 @@ class C {
expect(executable.returnType, isNull);
}
+ test_constructor_withCycles_const() {
+ serializeLibraryText('''
+class C {
+ final x;
+ const C() : x = const D();
+}
+class D {
+ final x;
+ const D() : x = const C();
+}
+class E {
+ final x;
+ const E() : x = null;
+}
+''');
+ int classCConstCycleSlot = findClass('C').executables[0].constCycleSlot;
+ expect(classCConstCycleSlot, isNot(0));
+ int classDConstCycleSlot = findClass('D').executables[0].constCycleSlot;
+ expect(classDConstCycleSlot, isNot(0));
+ int classEConstCycleSlot = findClass('E').executables[0].constCycleSlot;
+ expect(classEConstCycleSlot, isNot(0));
+ if (!skipFullyLinkedData) {
+ expect(definingUnit.constCycles, contains(classCConstCycleSlot));
+ expect(definingUnit.constCycles, contains(classDConstCycleSlot));
+ expect(definingUnit.constCycles, isNot(contains(classEConstCycleSlot)));
+ }
+ }
+
+ test_constructor_withCycles_nonConst() {
+ serializeLibraryText('''
+class C {
+ final x;
+ C() : x = new D();
+}
+class D {
+ final x;
+ D() : x = new C();
+}
+''');
+ expect(findClass('C').executables[0].constCycleSlot, 0);
+ expect(findClass('D').executables[0].constCycleSlot, 0);
+ }
+
test_dependencies_export_to_export_unused() {
addNamedSource('/a.dart', 'export "b.dart";');
addNamedSource('/b.dart', '');
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698