@@ -410,7 +410,6 @@ class SourceLoader extends Loader implements ProblemReportingHelper {
410410 SourceCompilationUnit ? origin,
411411 IndexedLibrary ? referencesFromIndex,
412412 bool ? referenceIsPartOwner,
413- bool isAugmentation = false ,
414413 bool isPatch = false ,
415414 required bool mayImplementRestrictedTypes,
416415 }) {
@@ -435,7 +434,6 @@ class SourceLoader extends Loader implements ProblemReportingHelper {
435434 ? target.uriTranslator.isLibraryImportable (importUri.path)
436435 : Importability .always),
437436 isAugmenting: origin != null ,
438- forAugmentationLibrary: isAugmentation,
439437 forPatchLibrary: isPatch,
440438 mayImplementRestrictedTypes: mayImplementRestrictedTypes,
441439 );
@@ -484,7 +482,6 @@ class SourceLoader extends Loader implements ProblemReportingHelper {
484482 required SourceCompilationUnit ? origin,
485483 required IndexedLibrary ? referencesFromIndex,
486484 required bool ? referenceIsPartOwner,
487- required bool isAugmentation,
488485 required bool isPatch,
489486 required bool addAsRoot,
490487 }) {
@@ -606,7 +603,6 @@ class SourceLoader extends Loader implements ProblemReportingHelper {
606603 origin: origin,
607604 referencesFromIndex: referencesFromIndex,
608605 referenceIsPartOwner: referenceIsPartOwner,
609- isAugmentation: isAugmentation,
610606 isPatch: isPatch,
611607 mayImplementRestrictedTypes: target.backendTarget.mayDefineRestrictedType (
612608 originImportUri,
@@ -694,7 +690,6 @@ class SourceLoader extends Loader implements ProblemReportingHelper {
694690 SourceCompilationUnit ? origin,
695691 IndexedLibrary ? referencesFromIndex,
696692 bool ? referenceIsPartOwner,
697- bool isAugmentation = false ,
698693 bool isPatch = false ,
699694 }) {
700695 CompilationUnit libraryBuilder = _read (
@@ -704,7 +699,6 @@ class SourceLoader extends Loader implements ProblemReportingHelper {
704699 origin: origin,
705700 referencesFromIndex: referencesFromIndex,
706701 referenceIsPartOwner: referenceIsPartOwner,
707- isAugmentation: isAugmentation,
708702 isPatch: isPatch,
709703 addAsRoot: false ,
710704 );
@@ -806,7 +800,6 @@ class SourceLoader extends Loader implements ProblemReportingHelper {
806800 fileUri: fileUri,
807801 referencesFromIndex: referencesFromIndex,
808802 addAsRoot: true ,
809- isAugmentation: false ,
810803 isPatch: false ,
811804 );
812805 // TODO(johnniwinther): Avoid using the first library, if present, as the
@@ -869,7 +862,6 @@ class SourceLoader extends Loader implements ProblemReportingHelper {
869862 SourceCompilationUnit ? origin,
870863 required IndexedLibrary ? referencesFromIndex,
871864 bool ? referenceIsPartOwner,
872- required bool isAugmentation,
873865 required bool isPatch,
874866 required bool addAsRoot,
875867 }) {
@@ -886,7 +878,6 @@ class SourceLoader extends Loader implements ProblemReportingHelper {
886878 origin: origin,
887879 referencesFromIndex: referencesFromIndex,
888880 referenceIsPartOwner: referenceIsPartOwner,
889- isAugmentation: isAugmentation,
890881 isPatch: isPatch,
891882 addAsRoot: addAsRoot,
892883 );
@@ -1191,7 +1182,11 @@ severity: $severity
11911182 compilationUnit.importUri,
11921183 compilationUnit.packageLanguageVersion.version,
11931184 ),
1194- forAugmentationLibrary: compilationUnit.forAugmentationLibrary,
1185+ forAugmentationLibrary: target.isExperimentEnabledInLibraryByVersion (
1186+ ExperimentalFlag .augmentations,
1187+ compilationUnit.importUri,
1188+ compilationUnit.packageLanguageVersion.version,
1189+ ),
11951190 ),
11961191 languageVersionChanged: (Scanner scanner, LanguageVersionToken version) {
11971192 if (! suppressLexicalErrors) {
@@ -1204,6 +1199,8 @@ severity: $severity
12041199 scanner.configuration = new ScannerConfiguration (
12051200 enableTripleShift:
12061201 compilationUnit.libraryFeatures.tripleShift.isEnabled,
1202+ forAugmentationLibrary:
1203+ compilationUnit.libraryFeatures.augmentations.isEnabled,
12071204 );
12081205 },
12091206 allowLazyStrings: allowLazyStrings,
0 commit comments