Index: pkg/kernel/test/type_parser.dart |
diff --git a/pkg/kernel/test/type_parser.dart b/pkg/kernel/test/type_parser.dart |
index d2e1b4dd9841d065d05a28291324ed1b6ffba33f..38209b4365e25bf3490f3d402d425246c48ac7f9 100644 |
--- a/pkg/kernel/test/type_parser.dart |
+++ b/pkg/kernel/test/type_parser.dart |
@@ -274,8 +274,14 @@ class DartTypeParser { |
class LazyTypeEnvironment { |
final Map<String, Class> classes = <String, Class>{}; |
final Map<String, TypeParameter> typeParameters = <String, TypeParameter>{}; |
- final Library dummyLibrary = |
- new Library(new Uri(path: 'dummy.dart'), name: 'lib'); |
+ Library dummyLibrary; |
+ final Program program = new Program(); |
+ |
+ LazyTypeEnvironment() { |
+ dummyLibrary = new Library(Uri.parse('file://dummy.dart')); |
+ program.libraries.add(dummyLibrary..parent = program); |
+ dummyLibrary.name = 'lib'; |
+ } |
TreeNode lookup(String name) { |
return name.length == 1 |