@@ -131,7 +131,7 @@ mixin ElementsTypesMixin {
131131 fragment.isAbstract = isAbstract;
132132 fragment.isAugmentation = isAugmentation;
133133 fragment.isSealed = isSealed;
134- fragment.enclosingFragment = testLibrary.definingCompilationUnit ;
134+ fragment.enclosingFragment = testLibrary.firstFragment ;
135135 fragment.typeParameters = typeParameters.map ((e) => e.asElement).toList ();
136136 fragment.methods = methods;
137137
@@ -158,7 +158,7 @@ mixin ElementsTypesMixin {
158158 fragment.isAbstract = isAbstract;
159159 fragment.isAugmentation = isAugmentation;
160160 fragment.isSealed = isSealed;
161- fragment.enclosingFragment = testLibrary.definingCompilationUnit ;
161+ fragment.enclosingFragment = testLibrary.firstFragment ;
162162 fragment.typeParameters = typeParameters
163163 .map ((e) => e.firstFragment)
164164 .toList ();
@@ -195,7 +195,7 @@ mixin ElementsTypesMixin {
195195 }) {
196196 var fragment = EnumFragmentImpl (name: name);
197197 EnumElementImpl (Reference .root (), fragment);
198- fragment.enclosingFragment = testLibrary.definingCompilationUnit ;
198+ fragment.enclosingFragment = testLibrary.firstFragment ;
199199 fragment.fields = constants;
200200 return fragment;
201201 }
@@ -206,7 +206,7 @@ mixin ElementsTypesMixin {
206206 }) {
207207 var fragment = EnumFragmentImpl (name: name);
208208 var element = EnumElementImpl (Reference .root (), fragment);
209- fragment.enclosingFragment = testLibrary.definingCompilationUnit ;
209+ fragment.enclosingFragment = testLibrary.firstFragment ;
210210 fragment.fields = constants;
211211 return element;
212212 }
@@ -226,7 +226,7 @@ mixin ElementsTypesMixin {
226226 ExtensionElementImpl (Reference .root (), element);
227227 element.element.extendedType = extendedType;
228228 element.isAugmentation = isAugmentation;
229- element.enclosingFragment = testLibrary.definingCompilationUnit ;
229+ element.enclosingFragment = testLibrary.firstFragment ;
230230 element.typeParameters = typeParameters;
231231 element.methods = methods;
232232 return element;
@@ -240,7 +240,7 @@ mixin ElementsTypesMixin {
240240 List <InterfaceTypeImpl > interfaces = const [],
241241 }) {
242242 var fragment = ExtensionTypeFragmentImpl (name: name);
243- fragment.enclosingFragment = testLibrary.definingCompilationUnit ;
243+ fragment.enclosingFragment = testLibrary.firstFragment ;
244244 fragment.typeParameters = typeParameters.map ((e) => e.asElement).toList ();
245245
246246 var fieldFragment = FieldFragmentImpl (name: representationName);
@@ -266,7 +266,7 @@ mixin ElementsTypesMixin {
266266 List <InterfaceTypeImpl > interfaces = const [],
267267 }) {
268268 var fragment = ExtensionTypeFragmentImpl (name: name);
269- fragment.enclosingFragment = testLibrary.definingCompilationUnit ;
269+ fragment.enclosingFragment = testLibrary.firstFragment ;
270270 fragment.typeParameters = typeParameters.map ((e) => e.asElement).toList ();
271271
272272 var fieldFragment = FieldFragmentImpl (name: representationName);
@@ -412,7 +412,7 @@ mixin ElementsTypesMixin {
412412 lineInfo: LineInfo ([0 ]),
413413 );
414414
415- library.definingCompilationUnit = definingUnit;
415+ library.firstFragment = definingUnit;
416416 library.typeProvider = typeSystem.typeProvider;
417417 library.typeSystem = typeSystem;
418418
@@ -476,7 +476,7 @@ mixin ElementsTypesMixin {
476476 }) {
477477 var fragment = MixinFragmentImpl (name: name);
478478 fragment.isAugmentation = isAugmentation;
479- fragment.enclosingFragment = testLibrary.definingCompilationUnit ;
479+ fragment.enclosingFragment = testLibrary.firstFragment ;
480480 fragment.typeParameters = typeParameters.map ((e) => e.asElement).toList ();
481481 fragment.constructors = const < ConstructorFragmentImpl > [];
482482
@@ -496,7 +496,7 @@ mixin ElementsTypesMixin {
496496 }) {
497497 var fragment = MixinFragmentImpl (name: name);
498498 fragment.isAugmentation = isAugmentation;
499- fragment.enclosingFragment = testLibrary.definingCompilationUnit ;
499+ fragment.enclosingFragment = testLibrary.firstFragment ;
500500 fragment.typeParameters = typeParameters.map ((e) => e.asElement).toList ();
501501 fragment.constructors = const < ConstructorFragmentImpl > [];
502502
@@ -640,7 +640,7 @@ mixin ElementsTypesMixin {
640640 required TypeImpl aliasedType,
641641 }) {
642642 var fragment = TypeAliasFragmentImpl (name: name, firstTokenOffset: null );
643- fragment.enclosingFragment = testLibrary.definingCompilationUnit ;
643+ fragment.enclosingFragment = testLibrary.firstFragment ;
644644 fragment.typeParameters = typeParameters.map ((e) => e.asElement).toList ();
645645
646646 var element = TypeAliasElementImpl (Reference .root (), fragment);
0 commit comments