@@ -3676,10 +3676,6 @@ abstract class FragmentImpl implements Fragment {
36763676
36773677 LibraryElementImpl ? get library;
36783678
3679- /// If this target is associated with a library, return the source of the
3680- /// library's defining compilation unit; otherwise return `null` .
3681- Source ? get librarySource => library? .source;
3682-
36833679 String ? get lookupName {
36843680 return name;
36853681 }
@@ -6438,9 +6434,6 @@ class LibraryFragmentImpl extends _ExistingFragmentImpl
64386434 return _libraryImports;
64396435 }
64406436
6441- @override
6442- Source get librarySource => library.source;
6443-
64446437 @override
64456438 List <MixinFragmentImpl > get mixins => _mixins;
64466439
@@ -8257,8 +8250,7 @@ class NeverFragmentImpl extends FragmentImpl implements TypeDefiningFragment {
82578250}
82588251
82598252/// A [VariableFragmentImpl] , which is not a parameter.
8260- abstract class NonParameterVariableFragmentImpl extends VariableFragmentImpl
8261- with _HasLibraryMixin {
8253+ abstract class NonParameterVariableFragmentImpl extends VariableFragmentImpl {
82628254 /// Initialize a newly created variable element to have the given [name] and
82638255 /// [offset] .
82648256 NonParameterVariableFragmentImpl ({required super .firstTokenOffset});
@@ -8276,6 +8268,18 @@ abstract class NonParameterVariableFragmentImpl extends VariableFragmentImpl
82768268 set hasInitializer (bool hasInitializer) {
82778269 setModifier (Modifier .HAS_INITIALIZER , hasInitializer);
82788270 }
8271+
8272+ @override
8273+ LibraryElementImpl get library {
8274+ var thisFragment = this as Fragment ;
8275+ var enclosingFragment = thisFragment.enclosingFragment! ;
8276+ var libraryFragment = enclosingFragment.libraryFragment;
8277+ libraryFragment as LibraryFragmentImpl ;
8278+ return libraryFragment.element;
8279+ }
8280+
8281+ @override
8282+ Source get source => enclosingFragment.source! ;
82798283}
82808284
82818285class PartIncludeImpl extends ElementDirectiveImpl implements PartInclude {
@@ -10438,12 +10442,9 @@ abstract class VariableFragmentImpl extends FragmentImpl
1043810442 }
1043910443}
1044010444
10441- abstract class _ExistingFragmentImpl extends FragmentImpl
10442- with _HasLibraryMixin {
10445+ abstract class _ExistingFragmentImpl extends FragmentImpl {
1044310446 _ExistingFragmentImpl ({required super .firstTokenOffset});
10444- }
1044510447
10446- mixin _HasLibraryMixin on FragmentImpl {
1044710448 @override
1044810449 LibraryElementImpl get library {
1044910450 var thisFragment = this as Fragment ;
@@ -10453,9 +10454,6 @@ mixin _HasLibraryMixin on FragmentImpl {
1045310454 return libraryFragment.element;
1045410455 }
1045510456
10456- @override
10457- Source get librarySource => library.source;
10458-
1045910457 @override
1046010458 Source get source => enclosingFragment! .source! ;
1046110459}
0 commit comments