Index: pkg/front_end/test/incremental_kernel_generator_test.dart |
diff --git a/pkg/front_end/test/incremental_kernel_generator_test.dart b/pkg/front_end/test/incremental_kernel_generator_test.dart |
index 804f216d9a595e4fb174de152218b540ed6eb964..8c963340b59a713fe31b40a89d979fef2fcb072b 100644 |
--- a/pkg/front_end/test/incremental_kernel_generator_test.dart |
+++ b/pkg/front_end/test/incremental_kernel_generator_test.dart |
@@ -145,6 +145,69 @@ static field a::A a; |
'''); |
} |
+ test_compile_export_cycle() async { |
+ writeFile('/test/.packages', 'test:lib/'); |
+ String aPath = '/test/lib/a.dart'; |
+ String bPath = '/test/lib/b.dart'; |
+ String cPath = '/test/lib/c.dart'; |
+ writeFile(aPath, 'export "b.dart"; class A {}'); |
+ writeFile(bPath, 'export "a.dart"; class B {}'); |
+ Uri cUri = writeFile( |
+ cPath, |
+ r''' |
+import 'b.dart'; |
+A a; |
+B b; |
+'''); |
+ |
+ { |
+ Program program = await getInitialState(cUri); |
+ Library library = _getLibrary(program, cUri); |
+ expect( |
+ _getLibraryText(library), |
+ r''' |
+library; |
+import self as self; |
+import "./a.dart" as a; |
+import "./b.dart" as b; |
+ |
+static field a::A a; |
+static field b::B b; |
+'''); |
+ } |
+ |
+ // Update c.dart and compile. |
+ // We should load the cycle [a.dart, b.dart] from the byte store. |
+ // This tests that we compute export scopes after loading. |
+ writeFile( |
+ cPath, |
+ r''' |
+import 'b.dart'; |
+A a; |
+B b; |
+int c; |
+'''); |
+ incrementalKernelGenerator.invalidate(cUri); |
+ { |
+ DeltaProgram delta = await incrementalKernelGenerator.computeDelta(); |
+ Program program = delta.newProgram; |
+ Library library = _getLibrary(program, cUri); |
+ expect( |
+ _getLibraryText(library), |
+ r''' |
+library; |
+import self as self; |
+import "./a.dart" as a; |
+import "./b.dart" as b; |
+import "dart:core" as core; |
+ |
+static field a::A a; |
+static field b::B b; |
+static field core::int c; |
+'''); |
+ } |
+ } |
+ |
test_compile_typedef() async { |
writeFile('/test/.packages', 'test:lib/'); |
String aPath = '/test/lib/a.dart'; |