[cfe] Handle patches as parts

Change-Id: I50a965b8061572af8a5e408b037648b1f7ff2e0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413201
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
diff --git a/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart b/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart
index 7401aff..7f2fb27 100644
--- a/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart
@@ -15371,6 +15371,28 @@
 );
 
 // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Null> codePatchExtensionOrigin = messagePatchExtensionOrigin;
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const MessageCode messagePatchExtensionOrigin = const MessageCode(
+  "PatchExtensionOrigin",
+  severity: Severity.context,
+  problemMessage: r"""This is the origin extension.""",
+);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Null> codePatchExtensionTypeParametersMismatch =
+    messagePatchExtensionTypeParametersMismatch;
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const MessageCode messagePatchExtensionTypeParametersMismatch =
+    const MessageCode(
+  "PatchExtensionTypeParametersMismatch",
+  problemMessage:
+      r"""A patch extension must have the same number of type variables as its origin extension.""",
+);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
 const Template<Message Function(String name, Uri uri_)>
     templatePatchInjectionFailed =
     const Template<Message Function(String name, Uri uri_)>(
diff --git a/pkg/front_end/lib/src/base/incremental_compiler.dart b/pkg/front_end/lib/src/base/incremental_compiler.dart
index 6824b0d9..90f46f1 100644
--- a/pkg/front_end/lib/src/base/incremental_compiler.dart
+++ b/pkg/front_end/lib/src/base/incremental_compiler.dart
@@ -1635,7 +1635,6 @@
     List<Library> removedLibraries = <Library>[];
     bool removedDillBuilders = false;
     for (Uri uri in potentiallyReferencedLibraries.keys) {
-      // Coverage-ignore-block(suite): Not run.
       if (uri.isScheme("package")) continue;
       LibraryBuilder? builder =
           currentKernelTarget.loader.deregisterLoadedLibraryBuilder(uri);
@@ -1655,12 +1654,13 @@
         _componentProblems.removeLibrary(lib, uriTranslator, partsUsed);
 
         // Technically this isn't necessary as the uri is not a package-uri.
-        _incrementalSerializer?.invalidate(builder.fileUri);
+        _incrementalSerializer
+            // Coverage-ignore(suite): Not run.
+            ?.invalidate(builder.fileUri);
       }
     }
     hierarchy.applyTreeChanges(removedLibraries, const [], const []);
     if (removedDillBuilders) {
-      // Coverage-ignore-block(suite): Not run.
       _makeDillLoaderLibrariesUpToDateWithBuildersMap();
     }
 
@@ -1693,7 +1693,6 @@
       [Map<Uri, Source>? uriToSourceExtra,
       Set<Uri?>? partsUsed]) {
     uriToSource.remove(builder.fileUri);
-    // Coverage-ignore(suite): Not run.
     uriToSourceExtra?.remove(builder.fileUri);
     Library lib = builder.library;
     for (LibraryPart part in lib.parts) {
diff --git a/pkg/front_end/lib/src/base/scope.dart b/pkg/front_end/lib/src/base/scope.dart
index 003b2c1..1a5b177 100644
--- a/pkg/front_end/lib/src/base/scope.dart
+++ b/pkg/front_end/lib/src/base/scope.dart
@@ -1237,6 +1237,7 @@
 
   SourceLibraryBuilder get originLibrary;
 
+  // Coverage-ignore(suite): Not run.
   void _addBuilderToMergedScope(
       String name, Builder newBuilder, Builder? existingBuilder,
       {required bool setter, required bool inPatchLibrary}) {
@@ -1276,7 +1277,6 @@
                 ? templateNonPatchLibraryConflict.withArguments(name)
                 : templateNonAugmentationLibraryConflict.withArguments(name);
           } else {
-            // Coverage-ignore-block(suite): Not run.
             message = inPatchLibrary
                 ? templateNonPatchClassMemberConflict.withArguments(name)
                 : templateNonAugmentationClassMemberConflict
@@ -1312,9 +1312,7 @@
         } else {
           message = inPatchLibrary
               ? templateUnmatchedPatchDeclaration.withArguments(name)
-              :
-              // Coverage-ignore(suite): Not run.
-              templateUnmatchedAugmentationDeclaration.withArguments(name);
+              : templateUnmatchedAugmentationDeclaration.withArguments(name);
         }
         originLibrary.addProblem(
             message, newBuilder.fileOffset, name.length, newBuilder.fileUri);
@@ -1351,6 +1349,7 @@
     if (augmentationMember == null) {
       augmentationNameSpace.addLocalMember(name, member, setter: setter);
       if (member is ExtensionBuilder) {
+        // Coverage-ignore-block(suite): Not run.
         augmentationNameSpace.addExtension(member);
       }
     }
@@ -1364,7 +1363,9 @@
     // `scope.forEachLocalMember`/`scope.forEachLocalSetter`.
 
     // Include all augmentation scope members to the origin scope.
-    nameSpace.forEachLocalMember((String name, Builder member) {
+    nameSpace.forEachLocalMember(
+        // Coverage-ignore(suite): Not run.
+        (String name, Builder member) {
       // In case of duplicates we use the first declaration.
       while (member.isDuplicate) {
         member = member.next!;
@@ -1374,6 +1375,7 @@
           setter: false, inPatchLibrary: inPatchLibrary);
     });
     if (augmentations != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (String augmentedName in augmentations.keys) {
         for (Builder augmentation in augmentations[augmentedName]!) {
           _addBuilderToMergedScope(augmentedName, augmentation,
@@ -1382,7 +1384,9 @@
         }
       }
     }
-    nameSpace.forEachLocalSetter((String name, Builder member) {
+    nameSpace.forEachLocalSetter(
+        // Coverage-ignore(suite): Not run.
+        (String name, Builder member) {
       // In case of duplicates we use the first declaration.
       while (member.isDuplicate) {
         member = member.next!;
@@ -1392,6 +1396,7 @@
           setter: true, inPatchLibrary: inPatchLibrary);
     });
     if (setterAugmentations != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (String augmentedName in setterAugmentations.keys) {
         for (Builder augmentation in setterAugmentations[augmentedName]!) {
           _addBuilderToMergedScope(augmentedName, augmentation,
@@ -1400,7 +1405,9 @@
         }
       }
     }
-    nameSpace.forEachLocalExtension((ExtensionBuilder extensionBuilder) {
+    nameSpace.forEachLocalExtension(
+        // Coverage-ignore(suite): Not run.
+        (ExtensionBuilder extensionBuilder) {
       if (extensionBuilder is SourceExtensionBuilder &&
           extensionBuilder.isUnnamedExtension) {
         _originNameSpace.addExtension(extensionBuilder);
@@ -1420,7 +1427,9 @@
       _addBuilderToAugmentationNameSpace(nameSpace, name, originMember,
           setter: true);
     });
-    _originNameSpace.forEachLocalExtension((ExtensionBuilder extensionBuilder) {
+    _originNameSpace.forEachLocalExtension(
+        // Coverage-ignore(suite): Not run.
+        (ExtensionBuilder extensionBuilder) {
       if (extensionBuilder is SourceExtensionBuilder &&
           extensionBuilder.isUnnamedExtension) {
         nameSpace.addExtension(extensionBuilder);
@@ -1433,6 +1442,7 @@
   bool _allowInjectedPublicMember(Builder newBuilder);
 }
 
+// Coverage-ignore(suite): Not run.
 class MergedLibraryScope extends MergedScope<SourceLibraryBuilder> {
   MergedLibraryScope(SourceLibraryBuilder origin)
       : super(origin, origin.libraryNameSpace);
@@ -1464,11 +1474,14 @@
         super(origin, origin.nameSpace);
 
   @override
+  // Coverage-ignore(suite): Not run.
   SourceLibraryBuilder get originLibrary => _origin.libraryBuilder;
 
   void _addAugmentationConstructorScope(DeclarationNameSpace nameSpace,
       {required bool inPatchLibrary}) {
-    nameSpace.forEachConstructor((String name, MemberBuilder newConstructor) {
+    nameSpace.forEachConstructor(
+        // Coverage-ignore(suite): Not run.
+        (String name, MemberBuilder newConstructor) {
       MemberBuilder? existingConstructor =
           _originConstructorNameSpace.lookupConstructor(name);
       bool isAugmentationBuilder = inPatchLibrary
@@ -1483,9 +1496,7 @@
               inPatchLibrary
                   ? templateNonPatchConstructorConflict
                       .withArguments(newConstructor.fullNameForErrors)
-                  :
-                  // Coverage-ignore(suite): Not run.
-                  templateNonAugmentationConstructorConflict
+                  : templateNonAugmentationConstructorConflict
                       .withArguments(newConstructor.fullNameForErrors),
               newConstructor.fileOffset,
               noLength,
@@ -1503,9 +1514,7 @@
               inPatchLibrary
                   ? templateUnmatchedPatchConstructor
                       .withArguments(newConstructor.fullNameForErrors)
-                  :
-                  // Coverage-ignore(suite): Not run.
-                  templateUnmatchedAugmentationConstructor
+                  : templateUnmatchedAugmentationConstructor
                       .withArguments(newConstructor.fullNameForErrors),
               newConstructor.fileOffset,
               noLength,
@@ -1514,7 +1523,6 @@
           _originConstructorNameSpace.addConstructor(name, newConstructor);
           for (DeclarationNameSpace augmentationConstructorNameSpace
               in _augmentationConstructorNameSpaces.values) {
-            // Coverage-ignore-block(suite): Not run.
             _addConstructorToAugmentationScope(
                 augmentationConstructorNameSpace, name, newConstructor);
           }
@@ -1522,7 +1530,6 @@
         if (inPatchLibrary &&
             !name.startsWith('_') &&
             !_allowInjectedPublicMember(newConstructor)) {
-          // Coverage-ignore-block(suite): Not run.
           originLibrary.addProblem(
               templatePatchInjectionFailed.withArguments(
                   name, originLibrary.importUri),
@@ -1561,13 +1568,13 @@
   }
 
   @override
+  // Coverage-ignore(suite): Not run.
   bool _allowInjectedPublicMember(Builder newBuilder) {
     if (originLibrary.importUri.isScheme("dart") &&
         originLibrary.importUri.path.startsWith("_")) {
       return true;
     }
     if (newBuilder.isStatic) {
-      // Coverage-ignore-block(suite): Not run.
       return _origin.name.startsWith('_');
     }
     // TODO(johnniwinther): Restrict the use of injected public class members.
@@ -1576,10 +1583,10 @@
 }
 
 extension on Builder {
+  // Coverage-ignore(suite): Not run.
   bool get isAugmentation {
     Builder self = this;
     if (self is SourceLibraryBuilder) {
-      // Coverage-ignore-block(suite): Not run.
       return self.isAugmentationLibrary;
     } else if (self is SourceClassBuilder) {
       return self.isAugmentation;
@@ -1602,6 +1609,7 @@
     return false;
   }
 
+  // Coverage-ignore(suite): Not run.
   void set isConflictingAugmentationMember(bool value) {
     Builder self = this;
     if (self is SourceMemberBuilder) {
@@ -1612,6 +1620,7 @@
     // TODO(johnniwinther): Handle all cases here.
   }
 
+  // Coverage-ignore(suite): Not run.
   bool _hasPatchAnnotation(Iterable<MetadataBuilder>? metadata) {
     if (metadata == null) {
       return false;
@@ -1624,6 +1633,7 @@
     return false;
   }
 
+  // Coverage-ignore(suite): Not run.
   bool get hasPatchAnnotation {
     Builder self = this;
     if (self is SourceFunctionBuilder) {
@@ -1636,9 +1646,7 @@
       return _hasPatchAnnotation(self.metadata);
     } else if (self is SourceMethodBuilder) {
       return _hasPatchAnnotation(self.metadata);
-    }
-    // Coverage-ignore(suite): Not run.
-    else if (self is SourceExtensionTypeDeclarationBuilder) {
+    } else if (self is SourceExtensionTypeDeclarationBuilder) {
       return _hasPatchAnnotation(self.metadata);
     }
     return false;
diff --git a/pkg/front_end/lib/src/builder/builder.dart b/pkg/front_end/lib/src/builder/builder.dart
index 65ab0ba..e6ceab3 100644
--- a/pkg/front_end/lib/src/builder/builder.dart
+++ b/pkg/front_end/lib/src/builder/builder.dart
@@ -248,6 +248,10 @@
 
   bool get isTypeParameter;
 
+  /// Adds [augmentation] to this declaration.
+  // TODO(johnniwinther): Remove this augmentations are based on fragments.
+  void addAugmentation(Builder augmentation);
+
   /// Applies [augmentation] to this declaration.
   void applyAugmentation(Builder augmentation);
 
@@ -356,6 +360,12 @@
 
   @override
   // Coverage-ignore(suite): Not run.
+  void addAugmentation(Builder augmentation) {
+    unsupported("${runtimeType}.addAugmentation", fileOffset, fileUri);
+  }
+
+  @override
+  // Coverage-ignore(suite): Not run.
   void applyAugmentation(Builder augmentation) {
     unsupported("${runtimeType}.applyAugmentation", fileOffset, fileUri);
   }
diff --git a/pkg/front_end/lib/src/builder/class_builder.dart b/pkg/front_end/lib/src/builder/class_builder.dart
index 9e0a6fa..94749e2 100644
--- a/pkg/front_end/lib/src/builder/class_builder.dart
+++ b/pkg/front_end/lib/src/builder/class_builder.dart
@@ -207,6 +207,7 @@
           forStaticAccess: true);
     }
     if (declaration == null && isAugmenting) {
+      // Coverage-ignore-block(suite): Not run.
       return origin.findStaticBuilder(
           name, fileOffset, fileUri, accessingLibrary,
           isSetter: isSetter);
diff --git a/pkg/front_end/lib/src/builder/declaration_builder.dart b/pkg/front_end/lib/src/builder/declaration_builder.dart
index f1722b6..5165953 100644
--- a/pkg/front_end/lib/src/builder/declaration_builder.dart
+++ b/pkg/front_end/lib/src/builder/declaration_builder.dart
@@ -73,6 +73,7 @@
     MemberBuilder? declaration =
         nameSpace.lookupConstructor(name == 'new' ? '' : name);
     if (declaration == null && isAugmenting) {
+      // Coverage-ignore-block(suite): Not run.
       return origin.findConstructorOrFactory(
           name, charOffset, uri, accessingLibrary);
     }
diff --git a/pkg/front_end/lib/src/builder/library_builder.dart b/pkg/front_end/lib/src/builder/library_builder.dart
index de0d0fc..a24a406 100644
--- a/pkg/front_end/lib/src/builder/library_builder.dart
+++ b/pkg/front_end/lib/src/builder/library_builder.dart
@@ -221,7 +221,8 @@
       LibraryNameSpaceBuilder libraryNameSpaceBuilder,
       SourceCompilationUnit parentCompilationUnit,
       List<SourceCompilationUnit> includedParts,
-      Set<Uri> usedParts);
+      Set<Uri> usedParts,
+      {required bool allowPartInParts});
 
   void buildOutlineExpressions(
       Annotatable annotatable, BodyBuilderContext bodyBuilderContext,
@@ -234,6 +235,10 @@
   Message reportFeatureNotEnabled(
       LibraryFeature feature, Uri fileUri, int charOffset, int length);
 
+  /// Registers that [augmentation] is a part of the library for which this is
+  /// the main compilation unit.
+  void registerAugmentation(CompilationUnit augmentation);
+
   /// Reports [message] on all compilation units that access this compilation
   /// unit.
   void addProblemAtAccessors(Message message);
diff --git a/pkg/front_end/lib/src/builder/synthesized_type_builder.dart b/pkg/front_end/lib/src/builder/synthesized_type_builder.dart
index 10b90ec..c640767 100644
--- a/pkg/front_end/lib/src/builder/synthesized_type_builder.dart
+++ b/pkg/front_end/lib/src/builder/synthesized_type_builder.dart
@@ -88,10 +88,6 @@
     DartType type = _typeBuilder.buildAliased(library, typeUse, hierarchy);
     Substitution substitution =
         _computeSubstitution(library, typeUse, hierarchy);
-    if ('$type'.contains('T*')) {
-      // Coverage-ignore-block(suite): Not run.
-      _typeBuilder.buildAliased(library, typeUse, hierarchy);
-    }
     return substitution.substituteType(type);
   }
 
diff --git a/pkg/front_end/lib/src/builder/type_parameter_builder.dart b/pkg/front_end/lib/src/builder/type_parameter_builder.dart
index 73b2ed0..38b5b89 100644
--- a/pkg/front_end/lib/src/builder/type_parameter_builder.dart
+++ b/pkg/front_end/lib/src/builder/type_parameter_builder.dart
@@ -258,6 +258,16 @@
   TypeParameter get parameter => origin.actualParameter;
 
   @override
+  // Coverage-ignore(suite): Not run.
+  void addAugmentation(covariant NominalParameterBuilder augmentation) {
+    assert(
+        _hasHashCode == null,
+        "Cannot apply augmentation since to $this since hashCode has already "
+        "been computed from $actualParameter @\n$_hasHashCode");
+    augmentation.actualOrigin = this;
+  }
+
+  @override
   void applyAugmentation(covariant NominalParameterBuilder augmentation) {
     assert(
         _hasHashCode == null,
@@ -725,6 +735,12 @@
 
   @override
   // Coverage-ignore(suite): Not run.
+  void addAugmentation(covariant StructuralParameterBuilder augmentation) {
+    augmentation.actualOrigin = this;
+  }
+
+  @override
+  // Coverage-ignore(suite): Not run.
   void applyAugmentation(covariant StructuralParameterBuilder augmentation) {
     augmentation.actualOrigin = this;
   }
diff --git a/pkg/front_end/lib/src/fragment/class.dart b/pkg/front_end/lib/src/fragment/class.dart
index cd19cc94..c699d60 100644
--- a/pkg/front_end/lib/src/fragment/class.dart
+++ b/pkg/front_end/lib/src/fragment/class.dart
@@ -48,7 +48,6 @@
   }
 
   @override
-  // Coverage-ignore(suite): Not run.
   bool get isPatch => enclosingCompilationUnit.isPatch && modifiers.isAugment;
 
   @override
diff --git a/pkg/front_end/lib/src/fragment/class/declaration.dart b/pkg/front_end/lib/src/fragment/class/declaration.dart
index 6d70b9f..6d867e5 100644
--- a/pkg/front_end/lib/src/fragment/class/declaration.dart
+++ b/pkg/front_end/lib/src/fragment/class/declaration.dart
@@ -33,6 +33,7 @@
   RegularClassDeclaration(this._fragment);
 
   @override
+  // Coverage-ignore(suite): Not run.
   List<MetadataBuilder>? get metadata => _fragment.metadata;
 
   @override
diff --git a/pkg/front_end/lib/src/fragment/constructor/declaration.dart b/pkg/front_end/lib/src/fragment/constructor/declaration.dart
index 862d38f..d1d8fde 100644
--- a/pkg/front_end/lib/src/fragment/constructor/declaration.dart
+++ b/pkg/front_end/lib/src/fragment/constructor/declaration.dart
@@ -272,6 +272,7 @@
   LookupScope get typeParameterScope => _fragment.typeParameterScope;
 
   @override
+  // Coverage-ignore(suite): Not run.
   List<MetadataBuilder>? get metadata => _fragment.metadata;
 
   @override
diff --git a/pkg/front_end/lib/src/fragment/enum.dart b/pkg/front_end/lib/src/fragment/enum.dart
index c9aed08..cde681d 100644
--- a/pkg/front_end/lib/src/fragment/enum.dart
+++ b/pkg/front_end/lib/src/fragment/enum.dart
@@ -50,8 +50,10 @@
   }
 
   @override
-  // Coverage-ignore(suite): Not run.
-  bool get isPatch => enclosingCompilationUnit.isPatch && modifiers.isAugment;
+  bool get isPatch =>
+      enclosingCompilationUnit.isPatch &&
+      // Coverage-ignore(suite): Not run.
+      modifiers.isAugment;
 
   @override
   void addEnumElement(EnumElementFragment fragment) {
diff --git a/pkg/front_end/lib/src/fragment/extension.dart b/pkg/front_end/lib/src/fragment/extension.dart
index fd44ffc..37cd2cc 100644
--- a/pkg/front_end/lib/src/fragment/extension.dart
+++ b/pkg/front_end/lib/src/fragment/extension.dart
@@ -47,7 +47,6 @@
   }
 
   @override
-  // Coverage-ignore(suite): Not run.
   bool get isPatch => enclosingCompilationUnit.isPatch && modifiers.isAugment;
 
   @override
diff --git a/pkg/front_end/lib/src/fragment/extension_type.dart b/pkg/front_end/lib/src/fragment/extension_type.dart
index 8f97449..c006b1a 100644
--- a/pkg/front_end/lib/src/fragment/extension_type.dart
+++ b/pkg/front_end/lib/src/fragment/extension_type.dart
@@ -48,8 +48,10 @@
   }
 
   @override
-  // Coverage-ignore(suite): Not run.
-  bool get isPatch => enclosingCompilationUnit.isPatch && modifiers.isAugment;
+  bool get isPatch =>
+      enclosingCompilationUnit.isPatch &&
+      // Coverage-ignore(suite): Not run.
+      modifiers.isAugment;
 
   @override
   void addPrimaryConstructorField(FieldFragment fragment) {
diff --git a/pkg/front_end/lib/src/fragment/fragment.dart b/pkg/front_end/lib/src/fragment/fragment.dart
index 847fe7d..889ccac 100644
--- a/pkg/front_end/lib/src/fragment/fragment.dart
+++ b/pkg/front_end/lib/src/fragment/fragment.dart
@@ -119,4 +119,7 @@
 abstract interface class DeclarationFragment {
   /// Returns `true` if this is a patch declaration.
   bool get isPatch;
+
+  /// Type parameters declared on this declaration.
+  List<TypeParameterFragment>? get typeParameters;
 }
diff --git a/pkg/front_end/lib/src/fragment/getter.dart b/pkg/front_end/lib/src/fragment/getter.dart
index cc5f145..e3f0079 100644
--- a/pkg/front_end/lib/src/fragment/getter.dart
+++ b/pkg/front_end/lib/src/fragment/getter.dart
@@ -935,6 +935,7 @@
   VariableDeclaration? getTearOffParameter(int index) => null;
 
   @override
+  // Coverage-ignore(suite): Not run.
   AugmentSuperTarget? get augmentSuperTarget {
     if (_fragment.builder.isAugmentation) {
       return _fragment.builder.augmentSuperTarget;
diff --git a/pkg/front_end/lib/src/fragment/method.dart b/pkg/front_end/lib/src/fragment/method.dart
index b065940..b888dc8 100644
--- a/pkg/front_end/lib/src/fragment/method.dart
+++ b/pkg/front_end/lib/src/fragment/method.dart
@@ -289,8 +289,13 @@
     ExtensionBuilder declarationBuilder =
         builder.declarationBuilder as ExtensionBuilder;
     SynthesizedExtensionSignature signature = new SynthesizedExtensionSignature(
-        declarationBuilder, unboundNominalParameters,
-        fileUri: fragment.fileUri, fileOffset: fragment.nameOffset);
+        declarationBuilder: declarationBuilder,
+        extensionTypeParameterFragments:
+            fragment.enclosingDeclaration!.typeParameters,
+        unboundNominalParameters: unboundNominalParameters,
+        onTypeBuilder: declarationBuilder.onType,
+        fileUri: fragment.fileUri,
+        fileOffset: fragment.nameOffset);
     return fragment.isOperator
         ? new _ExtensionInstanceOperatorEncoding(fragment,
             signature.clonedDeclarationTypeParameters, signature.thisFormal)
@@ -323,8 +328,12 @@
         builder.declarationBuilder as ExtensionTypeDeclarationBuilder;
     SynthesizedExtensionTypeSignature signature =
         new SynthesizedExtensionTypeSignature(
-            declarationBuilder, unboundNominalParameters,
-            fileUri: fragment.fileUri, fileOffset: fragment.nameOffset);
+            extensionTypeDeclarationBuilder: declarationBuilder,
+            extensionTypeTypeParameters:
+                fragment.enclosingDeclaration!.typeParameters,
+            unboundNominalParameters: unboundNominalParameters,
+            fileUri: fragment.fileUri,
+            fileOffset: fragment.nameOffset);
     return fragment.isOperator
         ? new _ExtensionTypeInstanceOperatorEncoding(fragment,
             signature.clonedDeclarationTypeParameters, signature.thisFormal)
@@ -1314,6 +1323,7 @@
       _fragment._encoding.getTearOffParameter(index);
 
   @override
+  // Coverage-ignore(suite): Not run.
   AugmentSuperTarget? get augmentSuperTarget {
     if (_fragment.builder.isAugmentation) {
       return _fragment.builder.augmentSuperTarget;
diff --git a/pkg/front_end/lib/src/fragment/mixin.dart b/pkg/front_end/lib/src/fragment/mixin.dart
index d4f61ee..2c0eff4 100644
--- a/pkg/front_end/lib/src/fragment/mixin.dart
+++ b/pkg/front_end/lib/src/fragment/mixin.dart
@@ -48,8 +48,10 @@
   }
 
   @override
-  // Coverage-ignore(suite): Not run.
-  bool get isPatch => enclosingCompilationUnit.isPatch && modifiers.isAugment;
+  bool get isPatch =>
+      enclosingCompilationUnit.isPatch &&
+      // Coverage-ignore(suite): Not run.
+      modifiers.isAugment;
 
   @override
   // Coverage-ignore(suite): Not run.
diff --git a/pkg/front_end/lib/src/fragment/setter.dart b/pkg/front_end/lib/src/fragment/setter.dart
index 9390254..85a1037 100644
--- a/pkg/front_end/lib/src/fragment/setter.dart
+++ b/pkg/front_end/lib/src/fragment/setter.dart
@@ -956,6 +956,7 @@
   VariableDeclaration? getTearOffParameter(int index) => null;
 
   @override
+  // Coverage-ignore(suite): Not run.
   AugmentSuperTarget? get augmentSuperTarget {
     if (_fragment.builder.isAugmentation) {
       return _fragment.builder.augmentSuperTarget;
diff --git a/pkg/front_end/lib/src/fragment/util.dart b/pkg/front_end/lib/src/fragment/util.dart
index 2ac045b..902c1b6 100644
--- a/pkg/front_end/lib/src/fragment/util.dart
+++ b/pkg/front_end/lib/src/fragment/util.dart
@@ -364,8 +364,13 @@
     ExtensionBuilder declarationBuilder =
         builder.declarationBuilder as ExtensionBuilder;
     SynthesizedExtensionSignature signature = new SynthesizedExtensionSignature(
-        declarationBuilder, unboundNominalParameters,
-        fileUri: fragment.fileUri, fileOffset: fragment.nameOffset);
+        declarationBuilder: declarationBuilder,
+        extensionTypeParameterFragments:
+            fragment.enclosingDeclaration!.typeParameters,
+        unboundNominalParameters: unboundNominalParameters,
+        onTypeBuilder: declarationBuilder.onType,
+        fileUri: fragment.fileUri,
+        fileOffset: fragment.nameOffset);
     return new _ExtensionInstanceGetterEncoding(fragment,
         signature.clonedDeclarationTypeParameters, signature.thisFormal);
   }
@@ -378,8 +383,13 @@
     ExtensionBuilder declarationBuilder =
         builder.declarationBuilder as ExtensionBuilder;
     SynthesizedExtensionSignature signature = new SynthesizedExtensionSignature(
-        declarationBuilder, unboundNominalParameters,
-        fileUri: fragment.fileUri, fileOffset: fragment.nameOffset);
+        declarationBuilder: declarationBuilder,
+        extensionTypeParameterFragments:
+            fragment.enclosingDeclaration!.typeParameters,
+        unboundNominalParameters: unboundNominalParameters,
+        onTypeBuilder: declarationBuilder.onType,
+        fileUri: fragment.fileUri,
+        fileOffset: fragment.nameOffset);
     return new _ExtensionInstanceSetterEncoding(fragment,
         signature.clonedDeclarationTypeParameters, signature.thisFormal);
   }
@@ -419,8 +429,12 @@
         builder.declarationBuilder as ExtensionTypeDeclarationBuilder;
     SynthesizedExtensionTypeSignature signature =
         new SynthesizedExtensionTypeSignature(
-            declarationBuilder, unboundNominalParameters,
-            fileUri: fragment.fileUri, fileOffset: fragment.nameOffset);
+            extensionTypeDeclarationBuilder: declarationBuilder,
+            extensionTypeTypeParameters:
+                fragment.enclosingDeclaration!.typeParameters,
+            unboundNominalParameters: unboundNominalParameters,
+            fileUri: fragment.fileUri,
+            fileOffset: fragment.nameOffset);
     return new _ExtensionTypeInstanceGetterEncoding(fragment,
         signature.clonedDeclarationTypeParameters, signature.thisFormal);
   }
@@ -434,8 +448,12 @@
         builder.declarationBuilder as ExtensionTypeDeclarationBuilder;
     SynthesizedExtensionTypeSignature signature =
         new SynthesizedExtensionTypeSignature(
-            declarationBuilder, unboundNominalParameters,
-            fileUri: fragment.fileUri, fileOffset: fragment.nameOffset);
+            extensionTypeDeclarationBuilder: declarationBuilder,
+            extensionTypeTypeParameters:
+                fragment.enclosingDeclaration!.typeParameters,
+            unboundNominalParameters: unboundNominalParameters,
+            fileUri: fragment.fileUri,
+            fileOffset: fragment.nameOffset);
     return new _ExtensionTypeInstanceSetterEncoding(fragment,
         signature.clonedDeclarationTypeParameters, signature.thisFormal);
   }
diff --git a/pkg/front_end/lib/src/kernel/augmentation_lowering.dart b/pkg/front_end/lib/src/kernel/augmentation_lowering.dart
index fba484d..9c47a75 100644
--- a/pkg/front_end/lib/src/kernel/augmentation_lowering.dart
+++ b/pkg/front_end/lib/src/kernel/augmentation_lowering.dart
@@ -7,6 +7,7 @@
 const String _augmentedNamePrefix = '_#';
 const String _augmentedNameSuffix = '#augment';
 
+// Coverage-ignore(suite): Not run.
 /// Creates the synthesized name to use for the [index]th augmented
 /// member by the given [name] in [library].
 ///
diff --git a/pkg/front_end/lib/src/kernel/body_builder.dart b/pkg/front_end/lib/src/kernel/body_builder.dart
index afd040a..23b3769 100644
--- a/pkg/front_end/lib/src/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/kernel/body_builder.dart
@@ -3195,6 +3195,7 @@
     bool isQualified = prefixToken != null;
     Builder? declaration = scope.lookupGetable(name, nameOffset, uri);
     if (declaration == null && prefix == null && _context.isAugmentationClass) {
+      // Coverage-ignore-block(suite): Not run.
       // The scope of an augmented method includes the origin class.
       declaration = _context.lookupStaticOriginMember(name, nameOffset, uri);
     }
@@ -7228,6 +7229,7 @@
   }
 
   @override
+  // Coverage-ignore(suite): Not run.
   void handleAugmentSuperExpression(
       Token augmentToken, Token superToken, IdentifierContext context) {
     debugEvent("AugmentSuperExpression");
diff --git a/pkg/front_end/lib/src/kernel/body_builder_context.dart b/pkg/front_end/lib/src/kernel/body_builder_context.dart
index 5d3459b..34359d4 100644
--- a/pkg/front_end/lib/src/kernel/body_builder_context.dart
+++ b/pkg/front_end/lib/src/kernel/body_builder_context.dart
@@ -123,6 +123,7 @@
   /// Returns `true` if the enclosing entity is an extension.
   bool get isExtensionDeclaration => _declarationContext.isExtensionDeclaration;
 
+  // Coverage-ignore(suite): Not run.
   /// Looks up the static member by the given [name] in the origin of the
   /// enclosing declaration.
   Builder? lookupStaticOriginMember(String name, int fileOffset, Uri fileUri) {
@@ -543,6 +544,7 @@
   bool get isAugmentationClass => _sourceClassBuilder.isAugmenting;
 
   @override
+  // Coverage-ignore(suite): Not run.
   Builder? lookupStaticOriginMember(String name, int fileOffset, Uri fileUri) {
     // The scope of an augmented method includes the origin class.
     return _sourceClassBuilder.origin
diff --git a/pkg/front_end/lib/src/kernel/expression_generator.dart b/pkg/front_end/lib/src/kernel/expression_generator.dart
index acda292..fcf3338 100644
--- a/pkg/front_end/lib/src/kernel/expression_generator.dart
+++ b/pkg/front_end/lib/src/kernel/expression_generator.dart
@@ -5058,6 +5058,7 @@
   }
 }
 
+// Coverage-ignore(suite): Not run.
 class AugmentSuperAccessGenerator extends Generator {
   final AugmentSuperTarget augmentSuperTarget;
 
@@ -5066,11 +5067,9 @@
       : super(helper, token);
 
   @override
-  // Coverage-ignore(suite): Not run.
   String get _debugName => "AugmentSuperGenerator";
 
   @override
-  // Coverage-ignore(suite): Not run.
   String get _plainNameForRead {
     return unsupported("augment super.plainNameForRead", fileOffset, _uri);
   }
@@ -5152,7 +5151,6 @@
       return buildCompoundAssignment(binaryOperator, value,
           offset: offset, voidContext: voidContext, isPostIncDec: true);
     }
-    // Coverage-ignore-block(suite): Not run.
     VariableDeclarationImpl read =
         _helper.createVariableDeclarationForValue(_createRead());
     Expression binary = _helper.forest.createBinary(offset,
@@ -5182,7 +5180,6 @@
   }
 
   @override
-  // Coverage-ignore(suite): Not run.
   void printOn(StringSink sink) {
     sink.write(", augmentSuperTarget: ");
     sink.write(augmentSuperTarget);
diff --git a/pkg/front_end/lib/src/kernel/internal_ast.dart b/pkg/front_end/lib/src/kernel/internal_ast.dart
index e88c9d5..b6d2012 100644
--- a/pkg/front_end/lib/src/kernel/internal_ast.dart
+++ b/pkg/front_end/lib/src/kernel/internal_ast.dart
@@ -815,9 +815,9 @@
   }
 
   @override
+  // Coverage-ignore(suite): Not run.
   void toTextInternal(AstPrinter printer) {
     if (literal == null) {
-      // Coverage-ignore-block(suite): Not run.
       printer.write('$value');
     } else {
       printer.write(literal!);
@@ -2967,6 +2967,7 @@
   }
 }
 
+// Coverage-ignore(suite): Not run.
 /// An augment super invocation of the form `augment super()`.
 ///
 /// This will be transformed into an [InstanceInvocation], [InstanceGet] plus
@@ -2994,17 +2995,16 @@
   }
 
   @override
-  // Coverage-ignore(suite): Not run.
   int get precedence => Precedence.PRIMARY;
 
   @override
-  // Coverage-ignore(suite): Not run.
   void toTextInternal(AstPrinter printer) {
     printer.write('augment super');
     printer.writeArguments(arguments);
   }
 }
 
+// Coverage-ignore(suite): Not run.
 /// An augment super read of the form `augment super`.
 ///
 /// This will be transformed into an [InstanceGet], [InstanceTearOff],
@@ -3029,16 +3029,15 @@
   }
 
   @override
-  // Coverage-ignore(suite): Not run.
   int get precedence => Precedence.PRIMARY;
 
   @override
-  // Coverage-ignore(suite): Not run.
   void toTextInternal(AstPrinter printer) {
     printer.write('augment super');
   }
 }
 
+// Coverage-ignore(suite): Not run.
 /// An augment super write of the form `augment super = e`.
 ///
 /// This will be transformed into an [InstanceSet], or [StaticSet] after type
@@ -3069,7 +3068,6 @@
   }
 
   @override
-  // Coverage-ignore(suite): Not run.
   void toTextInternal(AstPrinter printer) {
     printer.write('augment super = ');
     printer.writeExpression(value);
diff --git a/pkg/front_end/lib/src/kernel/kernel_target.dart b/pkg/front_end/lib/src/kernel/kernel_target.dart
index 5c2b46f..fadace7 100644
--- a/pkg/front_end/lib/src/kernel/kernel_target.dart
+++ b/pkg/front_end/lib/src/kernel/kernel_target.dart
@@ -1717,12 +1717,12 @@
     List<Uri>? patches = uriTranslator.getDartPatches(originImportUri.path);
     if (patches != null) {
       for (Uri patch in patches) {
-        loader.read(patch, -1,
+        compilationUnit.registerAugmentation(loader.read(patch, -1,
             fileUri: patch,
             originImportUri: originImportUri,
             origin: compilationUnit,
             accessor: compilationUnit,
-            isPatch: true);
+            isPatch: true));
       }
     }
   }
diff --git a/pkg/front_end/lib/src/source/builder_factory.dart b/pkg/front_end/lib/src/source/builder_factory.dart
index c5944a9..521d669 100644
--- a/pkg/front_end/lib/src/source/builder_factory.dart
+++ b/pkg/front_end/lib/src/source/builder_factory.dart
@@ -503,10 +503,17 @@
   /// methods and unnamed mixin applications, and for adding copies of
   /// extension type parameters to extension instance methods.
   static NominalParameterCopy? copyTypeParameters(
-      List<NominalParameterBuilder> unboundNominalParameters,
-      List<NominalParameterBuilder>? oldParameterBuilders,
-      {required TypeParameterKind kind,
+      {required List<NominalParameterBuilder> unboundNominalParameters,
+      required List<NominalParameterBuilder>? oldParameterBuilders,
+      List<TypeParameterFragment>? oldParameterFragments,
+      required TypeParameterKind kind,
       required InstanceTypeParameterAccessState instanceTypeParameterAccess}) {
+    assert(
+        oldParameterFragments == null ||
+            oldParameterBuilders?.length == oldParameterFragments.length,
+        "Invalid type parameter fragment count. "
+        "Expected ${oldParameterBuilders?.length}, "
+        "found ${oldParameterFragments.length}.");
     if (oldParameterBuilders == null || oldParameterBuilders.isEmpty) {
       return null;
     }
@@ -519,16 +526,20 @@
 
     List<NominalParameterBuilder> newVariableBuilders =
         <NominalParameterBuilder>[];
-    for (NominalParameterBuilder oldVariable in oldParameterBuilders) {
-      NominalParameterBuilder newVariable = new NominalParameterBuilder(
-          oldVariable.name, oldVariable.fileOffset, oldVariable.fileUri,
-          kind: kind,
-          variableVariance: oldVariable.parameter.isLegacyCovariant
-              ? null
-              :
-              // Coverage-ignore(suite): Not run.
-              oldVariable.variance,
-          isWildcard: oldVariable.isWildcard);
+    for (int index = 0; index < oldParameterBuilders.length; index++) {
+      NominalParameterBuilder oldVariable = oldParameterBuilders[index];
+      TypeParameterFragment? oldFragment = oldParameterFragments?[index];
+      Uri? fileUri = oldFragment?.fileUri ?? oldVariable.fileUri;
+      int fileOffset = oldFragment?.nameOffset ?? oldVariable.fileOffset;
+      NominalParameterBuilder newVariable =
+          new NominalParameterBuilder(oldVariable.name, fileOffset, fileUri,
+              kind: kind,
+              variableVariance: oldVariable.parameter.isLegacyCovariant
+                  ? null
+                  :
+                  // Coverage-ignore(suite): Not run.
+                  oldVariable.variance,
+              isWildcard: oldVariable.isWildcard);
       newVariableBuilders.add(newVariable);
       newToOldVariableMap[newVariable] = oldVariable;
       unboundNominalParameters.add(newVariable);
@@ -568,21 +579,27 @@
   SynthesizedExtensionSignature._(
       this.clonedDeclarationTypeParameters, this.thisFormal);
 
-  factory SynthesizedExtensionSignature(ExtensionBuilder declarationBuilder,
-      List<NominalParameterBuilder> unboundNominalParameters,
-      {required Uri fileUri, required int fileOffset}) {
+  factory SynthesizedExtensionSignature(
+      {required ExtensionBuilder declarationBuilder,
+      required List<TypeParameterFragment>? extensionTypeParameterFragments,
+      required TypeBuilder onTypeBuilder,
+      required List<NominalParameterBuilder> unboundNominalParameters,
+      required Uri fileUri,
+      required int fileOffset}) {
     List<NominalParameterBuilder>? clonedDeclarationTypeParameters;
 
     NominalParameterCopy? nominalVariableCopy =
         NominalParameterCopy.copyTypeParameters(
-            unboundNominalParameters, declarationBuilder.typeParameters,
+            unboundNominalParameters: unboundNominalParameters,
+            oldParameterBuilders: declarationBuilder.typeParameters,
+            oldParameterFragments: extensionTypeParameterFragments,
             kind: TypeParameterKind.extensionSynthesized,
             instanceTypeParameterAccess:
                 InstanceTypeParameterAccessState.Allowed);
 
     clonedDeclarationTypeParameters = nominalVariableCopy?.newParameterBuilders;
 
-    TypeBuilder thisType = declarationBuilder.onType;
+    TypeBuilder thisType = onTypeBuilder;
     if (nominalVariableCopy != null) {
       thisType = nominalVariableCopy.createInContext(thisType);
     }
@@ -611,15 +628,19 @@
       this.clonedDeclarationTypeParameters, this.thisFormal);
 
   factory SynthesizedExtensionTypeSignature(
-      ExtensionTypeDeclarationBuilder declarationBuilder,
-      List<NominalParameterBuilder> unboundNominalParameters,
-      {required Uri fileUri,
+      {required ExtensionTypeDeclarationBuilder extensionTypeDeclarationBuilder,
+      required List<TypeParameterFragment>? extensionTypeTypeParameters,
+      required List<NominalParameterBuilder> unboundNominalParameters,
+      required Uri fileUri,
       required int fileOffset}) {
     List<NominalParameterBuilder>? clonedDeclarationTypeParameters;
 
     NominalParameterCopy? nominalVariableCopy =
         NominalParameterCopy.copyTypeParameters(
-            unboundNominalParameters, declarationBuilder.typeParameters,
+            unboundNominalParameters: unboundNominalParameters,
+            oldParameterBuilders:
+                extensionTypeDeclarationBuilder.typeParameters,
+            oldParameterFragments: extensionTypeTypeParameters,
             kind: TypeParameterKind.extensionSynthesized,
             instanceTypeParameterAccess:
                 InstanceTypeParameterAccessState.Allowed);
@@ -627,10 +648,10 @@
     clonedDeclarationTypeParameters = nominalVariableCopy?.newParameterBuilders;
 
     TypeBuilder thisType = new NamedTypeBuilderImpl.fromTypeDeclarationBuilder(
-        declarationBuilder, const NullabilityBuilder.omitted(),
-        arguments: declarationBuilder.typeParameters != null
+        extensionTypeDeclarationBuilder, const NullabilityBuilder.omitted(),
+        arguments: extensionTypeTypeParameters != null
             ? new List<TypeBuilder>.generate(
-                declarationBuilder.typeParameters!.length,
+                extensionTypeTypeParameters.length,
                 (int index) =>
                     new NamedTypeBuilderImpl.fromTypeDeclarationBuilder(
                         clonedDeclarationTypeParameters![index],
diff --git a/pkg/front_end/lib/src/source/class_declaration.dart b/pkg/front_end/lib/src/source/class_declaration.dart
index 97e8d7b..8a61f11 100644
--- a/pkg/front_end/lib/src/source/class_declaration.dart
+++ b/pkg/front_end/lib/src/source/class_declaration.dart
@@ -84,31 +84,47 @@
 }
 
 mixin ClassDeclarationBuilderMixin implements ClassDeclarationBuilder {
-  List<ConstructorReferenceBuilder>? get constructorReferences;
+  List<ConstructorReferenceBuilder> get constructorReferences;
+
+  List<ClassDeclarationBuilderMixin>? get augmentations;
 
   LookupScope get bodyScope;
 
-  @override
-  int resolveConstructors(SourceLibraryBuilder library) {
-    if (constructorReferences == null) return 0;
-    for (ConstructorReferenceBuilder ref in constructorReferences!) {
-      ref.resolveIn(bodyScope, library);
-    }
-    int count = constructorReferences!.length;
-    if (count != 0) {
-      Iterator<MemberBuilder> iterator = nameSpace.filteredConstructorIterator(
-          parent: this, includeDuplicates: true, includeAugmentations: true);
-      while (iterator.moveNext()) {
-        MemberBuilder declaration = iterator.current;
-        if (declaration.declarationBuilder?.origin != origin) {
-          unexpected("$fileUri", "${declaration.declarationBuilder!.fileUri}",
-              fileOffset, fileUri);
-        }
-        if (declaration is SourceFactoryBuilder) {
-          declaration.resolveRedirectingFactory();
-        }
+  int resolveConstructorReferences(SourceLibraryBuilder library) {
+    int count = 0;
+    if (constructorReferences.isNotEmpty) {
+      for (ConstructorReferenceBuilder ref in constructorReferences) {
+        ref.resolveIn(bodyScope, library);
       }
     }
+    List<ClassDeclarationBuilderMixin>? augmentations = this.augmentations;
+    if (augmentations != null) {
+      for (ClassDeclarationBuilderMixin augmentation in augmentations) {
+        count += augmentation.resolveConstructorReferences(library);
+      }
+    }
+    return count;
+  }
+
+  void resolveConstructorRedirections() {
+    Iterator<MemberBuilder> iterator = nameSpace.filteredConstructorIterator(
+        parent: null, includeDuplicates: true, includeAugmentations: false);
+    while (iterator.moveNext()) {
+      MemberBuilder declaration = iterator.current;
+      if (declaration.declarationBuilder?.origin != origin) {
+        unexpected("$fileUri", "${declaration.declarationBuilder!.fileUri}",
+            fileOffset, fileUri);
+      }
+      if (declaration is SourceFactoryBuilder) {
+        declaration.resolveRedirectingFactory();
+      }
+    }
+  }
+
+  @override
+  int resolveConstructors(SourceLibraryBuilder library) {
+    int count = resolveConstructorReferences(library);
+    resolveConstructorRedirections();
     return count;
   }
 }
diff --git a/pkg/front_end/lib/src/source/diet_listener.dart b/pkg/front_end/lib/src/source/diet_listener.dart
index ea3ec33..80a7bbf 100644
--- a/pkg/front_end/lib/src/source/diet_listener.dart
+++ b/pkg/front_end/lib/src/source/diet_listener.dart
@@ -579,7 +579,10 @@
 
     // Native imports must be skipped because they aren't assigned corresponding
     // LibraryDependency nodes.
-    Token importUriToken = augmentToken?.next ?? importKeyword.next!;
+    Token importUriToken = augmentToken
+            // Coverage-ignore(suite): Not run.
+            ?.next ??
+        importKeyword.next!;
     String importUri =
         unescapeString(importUriToken.lexeme, importUriToken, this);
     if (importUri.startsWith("dart-ext:")) return;
diff --git a/pkg/front_end/lib/src/source/outline_builder.dart b/pkg/front_end/lib/src/source/outline_builder.dart
index 38b6e3f..1684424 100644
--- a/pkg/front_end/lib/src/source/outline_builder.dart
+++ b/pkg/front_end/lib/src/source/outline_builder.dart
@@ -718,6 +718,7 @@
     }
 
     if (augmentToken != null) {
+      // Coverage-ignore-block(suite): Not run.
       if (reportIfNotEnabled(libraryFeatures.macros, augmentToken.charOffset,
           augmentToken.length)) {
         augmentToken = null;
diff --git a/pkg/front_end/lib/src/source/source_builder_factory.dart b/pkg/front_end/lib/src/source/source_builder_factory.dart
index efb3179..fc9ed2d 100644
--- a/pkg/front_end/lib/src/source/source_builder_factory.dart
+++ b/pkg/front_end/lib/src/source/source_builder_factory.dart
@@ -660,7 +660,10 @@
         isPatch: _compilationUnit.isAugmenting,
         referencesFromIndex: indexedLibrary,
         referenceIsPartOwner: indexedLibrary != null);
-    _parts.add(new Part(charOffset, compilationUnit));
+    _parts.add(new Part(
+        fileUri: _compilationUnit.fileUri,
+        fileOffset: charOffset,
+        compilationUnit: compilationUnit));
 
     // TODO(ahe): [metadata] should be stored, evaluated, and added to [part].
     LibraryPart part = new LibraryPart(<Expression>[], uri)
@@ -743,10 +746,18 @@
     } else {
       resolvedUri = _resolve(_compilationUnit.importUri, uri, uriOffset);
       compilationUnit = loader.read(resolvedUri, uriOffset,
-          origin: isAugmentationImport ? _augmentationRoot : null,
+          origin: isAugmentationImport
+              ?
+              // Coverage-ignore(suite): Not run.
+              _augmentationRoot
+              : null,
           accessor: _compilationUnit,
           isAugmentation: isAugmentationImport,
-          referencesFromIndex: isAugmentationImport ? indexedLibrary : null);
+          referencesFromIndex: isAugmentationImport
+              ?
+              // Coverage-ignore(suite): Not run.
+              indexedLibrary
+              : null);
     }
 
     Import import = new Import(
@@ -827,6 +838,11 @@
       modifiers |= Modifiers.DeclaresConstConstructor;
     }
 
+    bool isPatch =
+        _compilationUnit.forPatchLibrary && _hasPatchAnnotation(metadata);
+    if (isPatch) {
+      modifiers |= Modifiers.Augment;
+    }
     declarationFragment.metadata = metadata;
     declarationFragment.modifiers = modifiers;
     declarationFragment.supertype = supertype;
@@ -1026,6 +1042,12 @@
         _problemReporting, typeParameters?.builders,
         ownerName: name, allowNameConflict: false);
 
+    bool isPatch =
+        _compilationUnit.forPatchLibrary && _hasPatchAnnotation(metadata);
+    if (isPatch) {
+      modifiers |= Modifiers.Augment;
+    }
+
     declarationFragment.metadata = metadata;
     declarationFragment.modifiers = modifiers;
     declarationFragment.onType = onType;
@@ -1352,6 +1374,11 @@
     NominalParameterNameSpace typeParameterNameSpace =
         _nominalParameterNameSpaces.pop();
 
+    bool isPatch =
+        _compilationUnit.forPatchLibrary && _hasPatchAnnotation(metadata);
+    if (isPatch) {
+      modifiers |= Modifiers.Augment;
+    }
     ConstructorFragment fragment = new ConstructorFragment(
         constructorName: constructorName,
         fileUri: _compilationUnit.fileUri,
@@ -1434,6 +1461,11 @@
     NominalParameterNameSpace typeParameterNameSpace =
         _nominalParameterNameSpaces.pop();
 
+    bool isPatch =
+        _compilationUnit.forPatchLibrary && _hasPatchAnnotation(metadata);
+    if (isPatch) {
+      modifiers |= Modifiers.Augment;
+    }
     FactoryFragment fragment = new FactoryFragment(
       constructorName: constructorName,
       fileUri: _compilationUnit.fileUri,
@@ -1646,6 +1678,11 @@
     NominalParameterNameSpace typeParameterNameSpace =
         _nominalParameterNameSpaces.pop();
 
+    bool isPatch =
+        _compilationUnit.forPatchLibrary && _hasPatchAnnotation(metadata);
+    if (isPatch) {
+      modifiers |= Modifiers.Augment;
+    }
     GetterFragment fragment = new GetterFragment(
         name: name,
         fileUri: _compilationUnit.fileUri,
@@ -1713,6 +1750,11 @@
     NominalParameterNameSpace typeParameterNameSpace =
         _nominalParameterNameSpaces.pop();
 
+    bool isPatch =
+        _compilationUnit.forPatchLibrary && _hasPatchAnnotation(metadata);
+    if (isPatch) {
+      modifiers |= Modifiers.Augment;
+    }
     SetterFragment fragment = new SetterFragment(
       name: name,
       fileUri: _compilationUnit.fileUri,
@@ -1783,6 +1825,11 @@
     NominalParameterNameSpace typeParameterNameSpace =
         _nominalParameterNameSpaces.pop();
 
+    bool isPatch =
+        _compilationUnit.forPatchLibrary && _hasPatchAnnotation(metadata);
+    if (isPatch) {
+      modifiers |= Modifiers.Augment;
+    }
     MethodFragment fragment = new MethodFragment(
       name: name,
       fileUri: _compilationUnit.fileUri,
@@ -2163,3 +2210,15 @@
   @override
   List<LibraryPart> get libraryParts => _libraryParts;
 }
+
+bool _hasPatchAnnotation(Iterable<MetadataBuilder>? metadata) {
+  if (metadata == null) {
+    return false;
+  }
+  for (MetadataBuilder metadataBuilder in metadata) {
+    if (metadataBuilder.hasPatch) {
+      return true;
+    }
+  }
+  return false;
+}
diff --git a/pkg/front_end/lib/src/source/source_class_builder.dart b/pkg/front_end/lib/src/source/source_class_builder.dart
index 4ff4998..e446511 100644
--- a/pkg/front_end/lib/src/source/source_class_builder.dart
+++ b/pkg/front_end/lib/src/source/source_class_builder.dart
@@ -125,7 +125,7 @@
   List<TypeBuilder>? _interfaceBuilders;
 
   @override
-  final List<ConstructorReferenceBuilder>? constructorReferences;
+  final List<ConstructorReferenceBuilder> constructorReferences;
 
   TypeBuilder? _mixedInTypeBuilder;
 
@@ -139,6 +139,7 @@
     return _isConflictingAugmentationMember ??= false;
   }
 
+  // Coverage-ignore(suite): Not run.
   void set isConflictingAugmentationMember(bool value) {
     assert(_isConflictingAugmentationMember == null,
         '$this.isConflictingAugmentationMember has already been fixed.');
@@ -182,6 +183,11 @@
   // TODO(johnniwinther): Remove this when augmentations are handled through
   //  fragments.
   @override
+  List<SourceClassBuilder>? get augmentations => _augmentations;
+
+  // TODO(johnniwinther): Remove this when augmentations are handled through
+  //  fragments.
+  @override
   LookupScope get bodyScope => _introductory.bodyScope;
 
   @override
@@ -233,10 +239,17 @@
   @override
   DeclarationNameSpace get nameSpace => _nameSpace;
 
+  // Coverage-ignore(suite): Not run.
   List<MetadataBuilder>? get metadata => _introductory.metadata;
 
   @override
   void buildScopes(LibraryBuilder coreLibrary) {
+    List<SourceClassBuilder>? augmentations = _augmentations;
+    if (augmentations != null) {
+      for (SourceClassBuilder augmentation in augmentations) {
+        nameSpaceBuilder.includeBuilders(augmentation.nameSpaceBuilder);
+      }
+    }
     _nameSpace = nameSpaceBuilder.buildNameSpace(
         loader: libraryBuilder.loader,
         problemReporting: libraryBuilder,
@@ -246,6 +259,12 @@
         indexedContainer: indexedClass,
         containerType: ContainerType.Class,
         containerName: new ClassName(name));
+    if (augmentations != null) {
+      for (SourceClassBuilder augmentation in augmentations) {
+        augmentation.buildScopes(coreLibrary);
+        _applyAugmentation(augmentation);
+      }
+    }
   }
 
   MergedClassMemberScope get mergedScope => _mergedScope ??= isAugmenting
@@ -374,8 +393,8 @@
   Class build(LibraryBuilder coreLibrary) {
     void buildBuilders(Builder declaration) {
       if (declaration.parent != this) {
+        // Coverage-ignore-block(suite): Not run.
         if (declaration.parent?.origin != origin) {
-          // Coverage-ignore-block(suite): Not run.
           if (fileUri != declaration.parent?.fileUri) {
             unexpected("$fileUri", "${declaration.parent?.fileUri}", fileOffset,
                 fileUri);
@@ -542,6 +561,14 @@
         .filteredIterator(
             parent: this, includeDuplicates: false, includeAugmentations: true)
         .forEach(build);
+
+    List<SourceClassBuilder>? augmentations = _augmentations;
+    if (augmentations != null) {
+      for (SourceClassBuilder augmentation in augmentations) {
+        augmentation.buildOutlineExpressions(
+            classHierarchy, delayedDefaultValueCloners);
+      }
+    }
   }
 
   @override
@@ -711,27 +738,15 @@
   }
 
   @override
-  void applyAugmentation(Builder augmentation) {
+  void addAugmentation(Builder augmentation) {
+    _addAugmentation(augmentation);
+  }
+
+  SourceClassBuilder? _addAugmentation(Builder augmentation) {
     if (augmentation is SourceClassBuilder) {
       augmentation.actualOrigin = this;
       (_augmentations ??= []).add(augmentation);
-
-      mergedScope.addAugmentationScope(augmentation);
-
-      int originLength = typeParameters?.length ?? 0;
-      int augmentationLength = augmentation.typeParameters?.length ?? 0;
-      if (originLength != augmentationLength) {
-        // Coverage-ignore-block(suite): Not run.
-        augmentation.addProblem(messagePatchClassTypeParametersMismatch,
-            augmentation.fileOffset, noLength, context: [
-          messagePatchClassOrigin.withLocation(fileUri, fileOffset, noLength)
-        ]);
-      } else if (typeParameters != null) {
-        int count = 0;
-        for (NominalParameterBuilder t in augmentation.typeParameters!) {
-          typeParameters![count++].applyAugmentation(t);
-        }
-      }
+      return augmentation;
     } else {
       // Coverage-ignore-block(suite): Not run.
       libraryBuilder.addProblem(messagePatchDeclarationMismatch,
@@ -739,6 +754,35 @@
         messagePatchDeclarationOrigin.withLocation(
             fileUri, fileOffset, noLength)
       ]);
+      return null;
+    }
+  }
+
+  @override
+  // Coverage-ignore(suite): Not run.
+  void applyAugmentation(Builder augmentation) {
+    SourceClassBuilder? classBuilder = _addAugmentation(augmentation);
+    if (classBuilder != null) {
+      _applyAugmentation(classBuilder);
+    }
+  }
+
+  void _applyAugmentation(SourceClassBuilder augmentation) {
+    mergedScope.addAugmentationScope(augmentation);
+
+    int originLength = typeParameters?.length ?? 0;
+    int augmentationLength = augmentation.typeParameters?.length ?? 0;
+    if (originLength != augmentationLength) {
+      // Coverage-ignore-block(suite): Not run.
+      augmentation.addProblem(messagePatchClassTypeParametersMismatch,
+          augmentation.fileOffset, noLength, context: [
+        messagePatchClassOrigin.withLocation(fileUri, fileOffset, noLength)
+      ]);
+    } else if (typeParameters != null) {
+      int count = 0;
+      for (NominalParameterBuilder t in augmentation.typeParameters!) {
+        typeParameters![count++].applyAugmentation(t);
+      }
     }
   }
 
@@ -1324,13 +1368,14 @@
         return;
       }
       if (builder is SourceMemberBuilder) {
-        count += builder.buildBodyNodes((
-            {required Member member,
-            Member? tearOff,
-            required BuiltMemberKind kind}) {
+        count += builder.buildBodyNodes(
+            // Coverage-ignore(suite): Not run.
+            (
+                {required Member member,
+                Member? tearOff,
+                required BuiltMemberKind kind}) {
           _addMemberToClass(builder, member);
           if (tearOff != null) {
-            // Coverage-ignore-block(suite): Not run.
             _addMemberToClass(builder, tearOff);
           }
         });
@@ -1354,9 +1399,8 @@
         !memberBuilder.isDuplicate &&
         !memberBuilder.isConflictingSetter) {
       if (memberBuilder.isConflictingAugmentationMember) {
-        if (member is Field &&
-                // Coverage-ignore(suite): Not run.
-                member.isStatic ||
+        // Coverage-ignore-block(suite): Not run.
+        if (member is Field && member.isStatic ||
             member is Procedure && member.isStatic) {
           member.name = new Name(
               '${member.name}'
@@ -2293,7 +2337,8 @@
 
       NominalParameterCopy nominalVariableCopy =
           NominalParameterCopy.copyTypeParameters(
-              unboundNominalParameters, typeParameters,
+              unboundNominalParameters: unboundNominalParameters,
+              oldParameterBuilders: typeParameters,
               kind: TypeParameterKind.extensionSynthesized,
               instanceTypeParameterAccess:
                   InstanceTypeParameterAccessState.Allowed)!;
diff --git a/pkg/front_end/lib/src/source/source_compilation_unit.dart b/pkg/front_end/lib/src/source/source_compilation_unit.dart
index c71ecd8..2f0e7ea 100644
--- a/pkg/front_end/lib/src/source/source_compilation_unit.dart
+++ b/pkg/front_end/lib/src/source/source_compilation_unit.dart
@@ -263,7 +263,6 @@
       originImportUri.isScheme("dart") || fileUri.isScheme("org-dartlang-sdk");
 
   @override
-  // Coverage-ignore(suite): Not run.
   bool get isPatch => forPatchLibrary;
 
   /// Returns the map of objects created in the [OutlineBuilder].
@@ -284,6 +283,13 @@
     return _libraryBuilder!;
   }
 
+  List<CompilationUnit>? _augmentations;
+
+  @override
+  void registerAugmentation(CompilationUnit augmentation) {
+    (_augmentations ??= []).add(augmentation);
+  }
+
   @override
   SourceCompilationUnit? get parentCompilationUnit => _parentCompilationUnit;
 
@@ -471,8 +477,8 @@
         "the compilation unit is finalized.");
     assert(_libraryBuilder == null,
         "Source library builder as already been created for $this.");
-    SourceLibraryBuilder libraryBuilder = _libraryBuilder =
-        new SourceLibraryBuilder(
+    SourceLibraryBuilder libraryBuilder =
+        _libraryBuilder = new SourceLibraryBuilder(
             compilationUnit: this,
             importUri: importUri,
             fileUri: fileUri,
@@ -481,7 +487,9 @@
             packageLanguageVersion: packageLanguageVersion,
             loader: loader,
             nameOrigin: _nameOrigin,
-            origin: _augmentationRoot?.libraryBuilder,
+            origin: _augmentationRoot
+                // Coverage-ignore(suite): Not run.
+                ?.libraryBuilder,
             target: library,
             indexedLibrary: indexedLibrary,
             referenceIsPartOwner: _referenceIsPartOwner,
@@ -590,14 +598,17 @@
   void includeParts(
       List<SourceCompilationUnit> includedParts, Set<Uri> usedParts) {
     _includeParts(
-        libraryBuilder, _libraryNameSpaceBuilder, includedParts, usedParts);
+        libraryBuilder: libraryBuilder,
+        libraryNameSpaceBuilder: _libraryNameSpaceBuilder,
+        includedParts: includedParts,
+        usedParts: usedParts);
   }
 
   void _includeParts(
-      SourceLibraryBuilder libraryBuilder,
-      LibraryNameSpaceBuilder libraryNameSpaceBuilder,
-      List<SourceCompilationUnit> includedParts,
-      Set<Uri> usedParts) {
+      {required SourceLibraryBuilder libraryBuilder,
+      required LibraryNameSpaceBuilder libraryNameSpaceBuilder,
+      required List<SourceCompilationUnit> includedParts,
+      required Set<Uri> usedParts}) {
     Set<Uri> seenParts = new Set<Uri>();
     for (Part part in _builderFactoryResult.parts) {
       // TODO(johnniwinther): Use [part.offset] in messages.
@@ -615,8 +626,15 @@
               ]);
         } else {
           usedParts.add(part.compilationUnit.importUri);
-          _includePart(libraryBuilder, libraryNameSpaceBuilder, this,
-              includedParts, part.compilationUnit, usedParts, part.offset);
+          _includePartIfValid(
+              libraryBuilder: libraryBuilder,
+              libraryNameSpaceBuilder: libraryNameSpaceBuilder,
+              parentCompilationUnit: this,
+              includedParts: includedParts,
+              part: part.compilationUnit,
+              usedParts: usedParts,
+              partOffset: part.fileOffset,
+              partUri: fileUri);
         }
       } else {
         addProblem(
@@ -626,16 +644,33 @@
             fileUri);
       }
     }
+    if (_augmentations != null) {
+      for (CompilationUnit augmentation in _augmentations!) {
+        switch (augmentation) {
+          case SourceCompilationUnit():
+            _includePart(libraryBuilder, libraryNameSpaceBuilder, this,
+                includedParts, augmentation, usedParts,
+                partOffset: -1,
+                partUri: augmentation.fileUri,
+                allowPartInParts: true);
+          // Coverage-ignore(suite): Not run.
+          case DillCompilationUnit():
+            // TODO(johnniwinther): Report an error here.
+            throw new UnsupportedError("Unexpected augmentation $augmentation");
+        }
+      }
+    }
   }
 
-  void _includePart(
-      SourceLibraryBuilder libraryBuilder,
-      LibraryNameSpaceBuilder libraryNameSpaceBuilder,
-      SourceCompilationUnit parentCompilationUnit,
-      List<SourceCompilationUnit> includedParts,
-      CompilationUnit part,
-      Set<Uri> usedParts,
-      int partOffset) {
+  void _includePartIfValid(
+      {required SourceLibraryBuilder libraryBuilder,
+      required LibraryNameSpaceBuilder libraryNameSpaceBuilder,
+      required SourceCompilationUnit parentCompilationUnit,
+      required List<SourceCompilationUnit> includedParts,
+      required CompilationUnit part,
+      required Set<Uri> usedParts,
+      required Uri partUri,
+      required int partOffset}) {
     switch (part) {
       case SourceCompilationUnit():
         if (part.partOfUri != null) {
@@ -680,38 +715,12 @@
           }
           return;
         }
-
-        // Language versions have to match. Except if (at least) one of them is
-        // invalid in which case we've already gotten an error about this.
-        if (parentCompilationUnit.languageVersion != part.languageVersion &&
-            // Coverage-ignore(suite): Not run.
-            parentCompilationUnit.languageVersion.valid &&
-            // Coverage-ignore(suite): Not run.
-            part.languageVersion.valid) {
-          // Coverage-ignore-block(suite): Not run.
-          // This is an error, but the part is not removed from the list of
-          // parts, so that metadata annotations can be associated with it.
-          List<LocatedMessage> context = <LocatedMessage>[];
-          if (parentCompilationUnit.languageVersion.isExplicit) {
-            context.add(messageLanguageVersionLibraryContext.withLocation(
-                parentCompilationUnit.languageVersion.fileUri!,
-                parentCompilationUnit.languageVersion.charOffset,
-                parentCompilationUnit.languageVersion.charCount));
-          }
-          if (part.languageVersion.isExplicit) {
-            context.add(messageLanguageVersionPartContext.withLocation(
-                part.languageVersion.fileUri!,
-                part.languageVersion.charOffset,
-                part.languageVersion.charCount));
-          }
-          parentCompilationUnit.addProblem(messageLanguageVersionMismatchInPart,
-              partOffset, noLength, parentCompilationUnit.fileUri,
-              context: context);
-        }
-
-        includedParts.add(part);
-        part.becomePart(libraryBuilder, libraryNameSpaceBuilder,
-            parentCompilationUnit, includedParts, usedParts);
+        _includePart(libraryBuilder, libraryNameSpaceBuilder,
+            parentCompilationUnit, includedParts, part, usedParts,
+            partOffset: partOffset,
+            partUri: partUri,
+            allowPartInParts:
+                parentCompilationUnit.libraryFeatures.enhancedParts.isEnabled);
       case DillCompilationUnit():
         // Trying to add a dill library builder as a part means that it exists
         // as a stand-alone library in the dill file.
@@ -730,6 +739,67 @@
     }
   }
 
+  void _includePart(
+      SourceLibraryBuilder libraryBuilder,
+      LibraryNameSpaceBuilder libraryNameSpaceBuilder,
+      SourceCompilationUnit parentCompilationUnit,
+      List<SourceCompilationUnit> includedParts,
+      SourceCompilationUnit part,
+      Set<Uri> usedParts,
+      {required int partOffset,
+      required Uri partUri,
+      required bool allowPartInParts}) {
+    // Language versions have to match. Except if (at least) one of them is
+    // invalid in which case we've already gotten an error about this.
+    if (parentCompilationUnit.languageVersion != part.languageVersion &&
+        // Coverage-ignore(suite): Not run.
+        parentCompilationUnit.languageVersion.valid &&
+        // Coverage-ignore(suite): Not run.
+        part.languageVersion.valid) {
+      // Coverage-ignore-block(suite): Not run.
+      // This is an error, but the part is not removed from the list of
+      // parts, so that metadata annotations can be associated with it.
+      List<LocatedMessage> context = <LocatedMessage>[];
+      if (parentCompilationUnit.languageVersion.isExplicit) {
+        context.add(messageLanguageVersionLibraryContext.withLocation(
+            parentCompilationUnit.languageVersion.fileUri!,
+            parentCompilationUnit.languageVersion.charOffset,
+            parentCompilationUnit.languageVersion.charCount));
+      }
+
+      if (part.isPatch) {
+        if (part.languageVersion.isExplicit) {
+          // Patches are implicitly include, so if we have an explicit language
+          // version, then point to this instead of the top of the file.
+          partOffset = part.languageVersion.charOffset;
+          partUri = part.languageVersion.fileUri!;
+          context.add(messageLanguageVersionPatchContext.withLocation(
+              part.languageVersion.fileUri!,
+              part.languageVersion.charOffset,
+              part.languageVersion.charCount));
+        }
+        parentCompilationUnit.addProblem(messageLanguageVersionMismatchInPatch,
+            partOffset, noLength, partUri,
+            context: context);
+      } else {
+        if (part.languageVersion.isExplicit) {
+          context.add(messageLanguageVersionPartContext.withLocation(
+              part.languageVersion.fileUri!,
+              part.languageVersion.charOffset,
+              part.languageVersion.charCount));
+        }
+        parentCompilationUnit.addProblem(
+            messageLanguageVersionMismatchInPart, partOffset, noLength, partUri,
+            context: context);
+      }
+    }
+
+    includedParts.add(part);
+    part.becomePart(libraryBuilder, libraryNameSpaceBuilder,
+        parentCompilationUnit, includedParts, usedParts,
+        allowPartInParts: allowPartInParts);
+  }
+
   void _becomePart(SourceLibraryBuilder libraryBuilder,
       LibraryNameSpaceBuilder libraryNameSpaceBuilder) {
     libraryNameSpaceBuilder.includeBuilders(_libraryNameSpaceBuilder);
@@ -780,7 +850,8 @@
       LibraryNameSpaceBuilder libraryNameSpaceBuilder,
       SourceCompilationUnit parentCompilationUnit,
       List<SourceCompilationUnit> includedParts,
-      Set<Uri> usedParts) {
+      Set<Uri> usedParts,
+      {required bool allowPartInParts}) {
     assert(
         _libraryBuilder == null,
         "Compilation unit $this is already part of library $_libraryBuilder. "
@@ -788,14 +859,14 @@
     _libraryBuilder = libraryBuilder;
     _partOfLibrary = libraryBuilder;
     _parentCompilationUnit = parentCompilationUnit;
-    if (!libraryFeatures.enhancedParts.isEnabled) {
+    if (!allowPartInParts) {
       if (_builderFactoryResult.parts.isNotEmpty) {
         List<LocatedMessage> context = <LocatedMessage>[
           messagePartInPartLibraryContext.withLocation(
               libraryBuilder.fileUri, -1, 1),
         ];
         for (Part part in _builderFactoryResult.parts) {
-          addProblem(messagePartInPart, part.offset, noLength, fileUri,
+          addProblem(messagePartInPart, part.fileOffset, noLength, fileUri,
               context: context);
           // Mark this part as used so we don't report it as orphaned.
           usedParts.add(part.compilationUnit.importUri);
@@ -806,7 +877,10 @@
     } else {
       _becomePart(libraryBuilder, libraryNameSpaceBuilder);
       _includeParts(
-          libraryBuilder, libraryNameSpaceBuilder, includedParts, usedParts);
+          libraryBuilder: libraryBuilder,
+          libraryNameSpaceBuilder: libraryNameSpaceBuilder,
+          includedParts: includedParts,
+          usedParts: usedParts);
     }
   }
 
diff --git a/pkg/front_end/lib/src/source/source_constructor_builder.dart b/pkg/front_end/lib/src/source/source_constructor_builder.dart
index da6ba41..61ed55b 100644
--- a/pkg/front_end/lib/src/source/source_constructor_builder.dart
+++ b/pkg/front_end/lib/src/source/source_constructor_builder.dart
@@ -57,9 +57,13 @@
   @override
   DeclarationBuilder get declarationBuilder;
 
+  void buildOutlineNodes(BuildNodesCallback f);
+
   void buildOutlineExpressions(ClassHierarchy classHierarchy,
       List<DelayedDefaultValueCloner> delayedDefaultValueCloners);
 
+  int buildBodyNodes(BuildNodesCallback f);
+
   /// Infers the types of any untyped initializing formals.
   void inferFormalTypes(ClassHierarchyBase hierarchy);
 
@@ -151,6 +155,7 @@
   Builder get parent => declarationBuilder;
 
   @override
+  // Coverage-ignore(suite): Not run.
   List<MetadataBuilder>? get metadata => _introductory.metadata;
 
   @override
@@ -209,8 +214,7 @@
   // Coverage-ignore(suite): Not run.
   List<SourceConstructorBuilder>? get augmentationsForTesting => _augmentations;
 
-  @override
-  void applyAugmentation(Builder augmentation) {
+  void _addAugmentation(Builder augmentation) {
     if (augmentation is SourceConstructorBuilderImpl) {
       if (checkAugmentation(
           augmentationLibraryBuilder: augmentation.libraryBuilder,
@@ -229,6 +233,17 @@
   }
 
   @override
+  void addAugmentation(Builder augmentation) {
+    _addAugmentation(augmentation);
+  }
+
+  @override
+  // Coverage-ignore(suite): Not run.
+  void applyAugmentation(Builder augmentation) {
+    _addAugmentation(augmentation);
+  }
+
+  @override
   bool get isRedirecting => _introductory.isRedirecting;
 
   @override
@@ -551,6 +566,13 @@
         // it has issues, so do the constructors.
         inErrorRecovery: inErrorRecovery);
     context.reportGenericFunctionTypesForFormals(formals);
+    List<SourceConstructorBuilderImpl>? augmentations = _augmentations;
+    if (augmentations != null) {
+      for (SourceConstructorBuilderImpl augmentation in augmentations) {
+        count += augmentation.computeDefaultTypes(context,
+            inErrorRecovery: inErrorRecovery);
+      }
+    }
     return count;
   }
 
@@ -622,14 +644,33 @@
         libraryBuilder: libraryBuilder,
         declarationConstructor: invokeTarget,
         delayedDefaultValueCloners: _delayedDefaultValueCloners);
+    List<SourceConstructorBuilder>? augmentations = _augmentations;
+    if (augmentations != null) {
+      for (SourceConstructorBuilder augmentation in augmentations) {
+        augmentation.buildOutlineNodes((
+            {required Member member,
+            Member? tearOff,
+            required BuiltMemberKind kind}) {
+          // Don't add augmentations.
+        });
+      }
+    }
   }
 
   @override
   int buildBodyNodes(BuildNodesCallback f) {
     _introductory.buildBody();
-    if (!isAugmenting) return 0;
-    _introductory.finishAugmentation(origin);
-    return 1;
+    int count = 0;
+    List<SourceConstructorBuilder>? augmentations = _augmentations;
+    if (augmentations != null) {
+      for (SourceConstructorBuilder augmentation in augmentations) {
+        count += augmentation.buildBodyNodes(f);
+      }
+    }
+    if (isAugmenting) {
+      _introductory.finishAugmentation(origin);
+    }
+    return count;
   }
 
   @override
@@ -707,9 +748,18 @@
 
     beginInitializers = null;
     _hasBuiltOutlines = true;
+
+    List<SourceConstructorBuilder>? augmentations = _augmentations;
+    if (augmentations != null) {
+      for (SourceConstructorBuilder augmentation in augmentations) {
+        augmentation.buildOutlineExpressions(
+            classHierarchy, delayedDefaultValueCloners);
+      }
+    }
   }
 
   @override
+  // Coverage-ignore(suite): Not run.
   String get fullNameForErrors {
     return "${declarationBuilder.name}"
         "${name.isEmpty ? '' : '.$name'}";
diff --git a/pkg/front_end/lib/src/source/source_extension_builder.dart b/pkg/front_end/lib/src/source/source_extension_builder.dart
index a6ff525..a16a8ad 100644
--- a/pkg/front_end/lib/src/source/source_extension_builder.dart
+++ b/pkg/front_end/lib/src/source/source_extension_builder.dart
@@ -5,7 +5,6 @@
 import 'package:kernel/ast.dart';
 import 'package:kernel/class_hierarchy.dart';
 
-import '../base/common.dart';
 import '../base/modifiers.dart';
 import '../base/name_space.dart';
 import '../base/problems.dart';
@@ -19,6 +18,8 @@
     show
         messagePatchDeclarationMismatch,
         messagePatchDeclarationOrigin,
+        messagePatchExtensionOrigin,
+        messagePatchExtensionTypeParametersMismatch,
         noLength;
 import '../fragment/fragment.dart';
 import '../kernel/body_builder_context.dart';
@@ -44,7 +45,7 @@
   late final Extension _extension;
 
   SourceExtensionBuilder? _origin;
-  SourceExtensionBuilder? augmentationForTesting;
+  SourceExtensionBuilder? _augmentation;
 
   MergedClassMemberScope? _mergedScope;
 
@@ -104,6 +105,7 @@
     extensionName.attachExtension(_extension);
   }
 
+  // Coverage-ignore(suite): Not run.
   // TODO(johnniwinther): Avoid exposing this. Annotations for macros and
   //  patches should be computing from within the builder.
   Iterable<MetadataBuilder>? get metadata => _introductory.metadata;
@@ -128,8 +130,15 @@
   @override
   bool get isAugment => _modifiers.isAugment;
 
+  // Coverage-ignore(suite): Not run.
+  SourceExtensionBuilder? get augmentationForTesting => _augmentation;
+
   @override
   void buildScopes(LibraryBuilder coreLibrary) {
+    SourceExtensionBuilder? augmentation = _augmentation;
+    if (augmentation != null) {
+      _nameSpaceBuilder.includeBuilders(augmentation._nameSpaceBuilder);
+    }
     _nameSpace = _nameSpaceBuilder.buildNameSpace(
         loader: libraryBuilder.loader,
         problemReporting: libraryBuilder,
@@ -142,6 +151,10 @@
         containerType: ContainerType.Extension,
         containerName: extensionName,
         includeConstructors: false);
+    if (augmentation != null) {
+      augmentation.buildScopes(coreLibrary);
+      _applyAugmentation(augmentation);
+    }
   }
 
   @override
@@ -203,6 +216,12 @@
         _introductory.enclosingScope);
 
     super.buildOutlineExpressions(classHierarchy, delayedDefaultValueCloners);
+
+    SourceExtensionBuilder? augmentation = _augmentation;
+    if (augmentation != null) {
+      augmentation.buildOutlineExpressions(
+          classHierarchy, delayedDefaultValueCloners);
+    }
   }
 
   @override
@@ -269,32 +288,15 @@
   }
 
   @override
-  void applyAugmentation(Builder augmentation) {
+  void addAugmentation(Builder augmentation) {
+    _addAugmentation(augmentation);
+  }
+
+  SourceExtensionBuilder? _addAugmentation(Builder augmentation) {
     if (augmentation is SourceExtensionBuilder) {
       augmentation._origin = this;
-      if (retainDataForTesting) {
-        // Coverage-ignore-block(suite): Not run.
-        augmentationForTesting = augmentation;
-      }
-      // TODO(johnniwinther): Check that type parameters and on-type match
-      // with origin declaration.
-
-      nameSpace.forEachLocalMember((String name, Builder member) {
-        Builder? memberAugmentation =
-            augmentation.nameSpace.lookupLocalMember(name, setter: false);
-        if (memberAugmentation != null) {
-          member.applyAugmentation(memberAugmentation);
-        }
-      });
-      nameSpace.forEachLocalSetter(
-          // Coverage-ignore(suite): Not run.
-          (String name, Builder member) {
-        Builder? memberAugmentation =
-            augmentation.nameSpace.lookupLocalMember(name, setter: true);
-        if (memberAugmentation != null) {
-          member.applyAugmentation(memberAugmentation);
-        }
-      });
+      _augmentation = augmentation;
+      return augmentation;
     } else {
       // Coverage-ignore-block(suite): Not run.
       libraryBuilder.addProblem(messagePatchDeclarationMismatch,
@@ -302,6 +304,51 @@
         messagePatchDeclarationOrigin.withLocation(
             fileUri, fileOffset, noLength)
       ]);
+      return null;
+    }
+  }
+
+  void _applyAugmentation(SourceExtensionBuilder augmentation) {
+    // TODO(johnniwinther): Check that on-type match with origin declaration.
+
+    int originLength = typeParameters?.length ?? 0;
+    int augmentationLength = augmentation.typeParameters?.length ?? 0;
+    if (originLength != augmentationLength) {
+      // Coverage-ignore-block(suite): Not run.
+      augmentation.addProblem(messagePatchExtensionTypeParametersMismatch,
+          augmentation.fileOffset, noLength, context: [
+        messagePatchExtensionOrigin.withLocation(fileUri, fileOffset, noLength)
+      ]);
+    } else if (typeParameters != null) {
+      int count = 0;
+      for (NominalParameterBuilder t in augmentation.typeParameters!) {
+        typeParameters![count++].applyAugmentation(t);
+      }
+    }
+    nameSpace.forEachLocalMember((String name, Builder member) {
+      Builder? memberAugmentation =
+          augmentation.nameSpace.lookupLocalMember(name, setter: false);
+      if (memberAugmentation != null) {
+        // Coverage-ignore-block(suite): Not run.
+        member.applyAugmentation(memberAugmentation);
+      }
+    });
+    nameSpace.forEachLocalSetter((String name, Builder member) {
+      Builder? memberAugmentation =
+          augmentation.nameSpace.lookupLocalMember(name, setter: true);
+      if (memberAugmentation != null) {
+        // Coverage-ignore-block(suite): Not run.
+        member.applyAugmentation(memberAugmentation);
+      }
+    });
+  }
+
+  @override
+  // Coverage-ignore(suite): Not run.
+  void applyAugmentation(Builder augmentation) {
+    SourceExtensionBuilder? extensionBuilder = _addAugmentation(augmentation);
+    if (extensionBuilder != null) {
+      _applyAugmentation(extensionBuilder);
     }
   }
 }
diff --git a/pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart b/pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart
index c4b0197..17e2392c 100644
--- a/pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart
+++ b/pkg/front_end/lib/src/source/source_extension_type_declaration_builder.dart
@@ -61,7 +61,7 @@
   final Modifiers _modifiers;
 
   @override
-  final List<ConstructorReferenceBuilder>? constructorReferences;
+  final List<ConstructorReferenceBuilder> constructorReferences;
 
   late final ExtensionTypeDeclaration _extensionTypeDeclaration;
 
@@ -90,6 +90,8 @@
 
   Nullability? _nullability;
 
+  SourceExtensionTypeDeclarationBuilder? _augmentation;
+
   SourceExtensionTypeDeclarationBuilder(
       {required this.name,
       required SourceLibraryBuilder enclosingLibraryBuilder,
@@ -127,6 +129,16 @@
   // TODO(johnniwinther): Remove this when augmentations are handled through
   //  fragments.
   @override
+  List<SourceExtensionTypeDeclarationBuilder>? get augmentations =>
+      _augmentation != null
+          ?
+          // Coverage-ignore(suite): Not run.
+          [_augmentation!]
+          : const [];
+
+  // TODO(johnniwinther): Remove this when augmentations are handled through
+  //  fragments.
+  @override
   LookupScope get bodyScope => _introductory.bodyScope;
 
   // Coverage-ignore(suite): Not run.
@@ -162,6 +174,11 @@
         indexedContainer: indexedContainer,
         containerType: ContainerType.ExtensionType,
         containerName: new ClassName(name));
+    SourceExtensionTypeDeclarationBuilder? augmentation = _augmentation;
+    if (augmentation != null) {
+      // Coverage-ignore-block(suite): Not run.
+      _applyAugmentation(augmentation);
+    }
   }
 
   @override
@@ -835,32 +852,55 @@
 
   @override
   // Coverage-ignore(suite): Not run.
-  void applyAugmentation(Builder augmentation) {
+  void addAugmentation(Builder augmentation) {
+    _addAugmentation(augmentation);
+  }
+
+  // Coverage-ignore(suite): Not run.
+  SourceExtensionTypeDeclarationBuilder? _addAugmentation(
+      Builder augmentation) {
     if (augmentation is SourceExtensionTypeDeclarationBuilder) {
       augmentation._origin = this;
-      nameSpace.forEachLocalMember((String name, Builder member) {
-        Builder? memberAugmentation =
-            augmentation.nameSpace.lookupLocalMember(name, setter: false);
-        if (memberAugmentation != null) {
-          member.applyAugmentation(memberAugmentation);
-        }
-      });
-      nameSpace.forEachLocalSetter((String name, Builder member) {
-        Builder? memberAugmentation =
-            augmentation.nameSpace.lookupLocalMember(name, setter: true);
-        if (memberAugmentation != null) {
-          member.applyAugmentation(memberAugmentation);
-        }
-      });
-
-      // TODO(johnniwinther): Check that type parameters and on-type match
-      // with origin declaration.
+      _augmentation = augmentation;
+      return augmentation;
     } else {
       libraryBuilder.addProblem(messagePatchDeclarationMismatch,
           augmentation.fileOffset, noLength, augmentation.fileUri, context: [
         messagePatchDeclarationOrigin.withLocation(
             fileUri, fileOffset, noLength)
       ]);
+      return null;
+    }
+  }
+
+  // Coverage-ignore(suite): Not run.
+  void _applyAugmentation(SourceExtensionTypeDeclarationBuilder augmentation) {
+    nameSpace.forEachLocalMember((String name, Builder member) {
+      Builder? memberAugmentation =
+          augmentation.nameSpace.lookupLocalMember(name, setter: false);
+      if (memberAugmentation != null) {
+        member.applyAugmentation(memberAugmentation);
+      }
+    });
+    nameSpace.forEachLocalSetter((String name, Builder member) {
+      Builder? memberAugmentation =
+          augmentation.nameSpace.lookupLocalMember(name, setter: true);
+      if (memberAugmentation != null) {
+        member.applyAugmentation(memberAugmentation);
+      }
+    });
+
+    // TODO(johnniwinther): Check that type parameters and on-type match
+    // with origin declaration.
+  }
+
+  @override
+  // Coverage-ignore(suite): Not run.
+  void applyAugmentation(Builder augmentation) {
+    SourceExtensionTypeDeclarationBuilder? extensionTypeDeclarationBuilder =
+        _addAugmentation(augmentation);
+    if (extensionTypeDeclarationBuilder != null) {
+      _applyAugmentation(extensionTypeDeclarationBuilder);
     }
   }
 
diff --git a/pkg/front_end/lib/src/source/source_factory_builder.dart b/pkg/front_end/lib/src/source/source_factory_builder.dart
index 8a1e03f..1a644c9 100644
--- a/pkg/front_end/lib/src/source/source_factory_builder.dart
+++ b/pkg/front_end/lib/src/source/source_factory_builder.dart
@@ -101,6 +101,7 @@
             tearOffReference: tearOffReference);
 
   @override
+  // Coverage-ignore(suite): Not run.
   List<MetadataBuilder>? get metadata => _introductory.metadata;
 
   @override
@@ -274,7 +275,11 @@
       throw new UnsupportedError('${runtimeType}.localSetters');
 
   @override
-  void applyAugmentation(Builder augmentation) {
+  void addAugmentation(Builder augmentation) {
+    _addAugmentation(augmentation);
+  }
+
+  void _addAugmentation(Builder augmentation) {
     if (augmentation is SourceFactoryBuilder) {
       if (checkAugmentation(
           augmentationLibraryBuilder: augmentation.libraryBuilder,
@@ -293,17 +298,39 @@
   }
 
   @override
+  // Coverage-ignore(suite): Not run.
+  void applyAugmentation(Builder augmentation) {
+    _addAugmentation(augmentation);
+  }
+
+  @override
   int buildBodyNodes(BuildNodesCallback f) {
-    if (!isAugmenting) return 0;
-    _finishAugmentation();
-    return 1;
+    int count = 0;
+    List<SourceFactoryBuilder>? augmentations = _augmentations;
+    if (augmentations != null) {
+      for (SourceFactoryBuilder augmentation in augmentations) {
+        count += augmentation.buildBodyNodes(f);
+      }
+    }
+    if (isAugmenting) {
+      _finishAugmentation();
+    }
+    return count;
   }
 
   @override
   int computeDefaultTypes(ComputeDefaultTypeContext context,
       {required bool inErrorRecovery}) {
-    return _encoding.computeDefaultTypes(context,
+    int count = _encoding.computeDefaultTypes(context,
         inErrorRecovery: inErrorRecovery);
+    List<SourceFactoryBuilder>? augmentations = _augmentations;
+    if (augmentations != null) {
+      for (SourceFactoryBuilder augmentation in augmentations) {
+        count += augmentation.computeDefaultTypes(context,
+            inErrorRecovery: inErrorRecovery);
+      }
+    }
+    return count;
   }
 
   @override
@@ -377,6 +404,17 @@
   @override
   void buildOutlineNodes(BuildNodesCallback f) {
     _encoding.buildOutlineNodes(f);
+    List<SourceFactoryBuilder>? augmentations = _augmentations;
+    if (augmentations != null) {
+      for (SourceFactoryBuilder augmentation in augmentations) {
+        augmentation.buildOutlineNodes((
+            {required Member member,
+            Member? tearOff,
+            required BuiltMemberKind kind}) {
+          // Don't add augmentations.
+        });
+      }
+    }
   }
 
   bool _hasBuiltOutlineExpressions = false;
@@ -398,6 +436,14 @@
     if (isConst && isAugmenting) {
       _finishAugmentation();
     }
+
+    List<SourceFactoryBuilder>? augmentations = _augmentations;
+    if (augmentations != null) {
+      for (SourceFactoryBuilder augmentation in augmentations) {
+        augmentation.buildOutlineExpressions(
+            classHierarchy, delayedDefaultValueCloners);
+      }
+    }
   }
 
   void _finishAugmentation() {
@@ -421,6 +467,13 @@
 
   void resolveRedirectingFactory() {
     _encoding.resolveRedirectingFactory();
+
+    List<SourceFactoryBuilder>? augmentations = _augmentations;
+    if (augmentations != null) {
+      for (SourceFactoryBuilder augmentation in augmentations) {
+        augmentation.resolveRedirectingFactory();
+      }
+    }
   }
 
   void _setRedirectingFactoryBody(Member target, List<DartType> typeArguments) {
diff --git a/pkg/front_end/lib/src/source/source_function_builder.dart b/pkg/front_end/lib/src/source/source_function_builder.dart
index f8b76fa..48fbc4b 100644
--- a/pkg/front_end/lib/src/source/source_function_builder.dart
+++ b/pkg/front_end/lib/src/source/source_function_builder.dart
@@ -163,7 +163,9 @@
     {required SourceLibraryBuilder augmentationLibraryBuilder,
     required Builder origin,
     required Builder augmentation}) {
-  if (!origin.isExternal && !augmentationLibraryBuilder.isAugmentationLibrary) {
+  if (!origin.isExternal &&
+      // Coverage-ignore(suite): Not run.
+      !augmentationLibraryBuilder.isAugmentationLibrary) {
     // Coverage-ignore-block(suite): Not run.
     augmentationLibraryBuilder.addProblem(messagePatchNonExternal,
         augmentation.fileOffset, noLength, augmentation.fileUri!,
diff --git a/pkg/front_end/lib/src/source/source_library_builder.dart b/pkg/front_end/lib/src/source/source_library_builder.dart
index 0011b37..39d5f8b 100644
--- a/pkg/front_end/lib/src/source/source_library_builder.dart
+++ b/pkg/front_end/lib/src/source/source_library_builder.dart
@@ -241,7 +241,9 @@
       required NameSpace importNameSpace,
       required LibraryNameSpaceBuilder libraryNameSpaceBuilder}) {
     Library library = target ??
-        (origin?.library ??
+        (origin
+                // Coverage-ignore(suite): Not run.
+                ?.library ??
             new Library(importUri,
                 fileUri: fileUri,
                 reference: referenceIsPartOwner == true
@@ -249,7 +251,10 @@
                     : indexedLibrary?.library.reference)
           ..setLanguageVersion(packageLanguageVersion.version));
     LibraryName libraryName = new LibraryName(library.reference);
-    NameSpace exportNameSpace = origin?.exportNameSpace ?? new NameSpaceImpl();
+    NameSpace exportNameSpace = origin
+            // Coverage-ignore(suite): Not run.
+            ?.exportNameSpace ??
+        new NameSpaceImpl();
     return new SourceLibraryBuilder._(
         compilationUnit: compilationUnit,
         loader: loader,
@@ -355,6 +360,7 @@
   bool get mayImplementRestrictedTypes =>
       compilationUnit.mayImplementRestrictedTypes;
 
+  // Coverage-ignore(suite): Not run.
   /// `true` if this is an augmentation library.
   bool get isAugmentationLibrary => compilationUnit.forAugmentationLibrary;
 
@@ -364,6 +370,7 @@
   @override
   bool get isUnsupported => compilationUnit.isUnsupported;
 
+  // Coverage-ignore(suite): Not run.
   MergedLibraryScope get mergedScope {
     return _mergedScope ??=
         isAugmenting ? origin.mergedScope : new MergedLibraryScope(this);
@@ -397,6 +404,7 @@
   Iterable<SourceCompilationUnit> get parts => _parts;
 
   @override
+  // Coverage-ignore(suite): Not run.
   bool get isPart => compilationUnit.isPart;
 
   @override
@@ -417,6 +425,7 @@
   Iterable<SourceLibraryBuilder>? get augmentationLibraries =>
       _augmentationLibraries;
 
+  // Coverage-ignore(suite): Not run.
   void addAugmentationLibrary(SourceLibraryBuilder augmentationLibrary) {
     assert(augmentationLibrary.isAugmenting,
         "Library ${augmentationLibrary} must be a augmentation library.");
@@ -461,6 +470,7 @@
     Iterable<SourceLibraryBuilder>? augmentationLibraries =
         this.augmentationLibraries;
     if (augmentationLibraries != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
         augmentationLibrary.computeSupertypes();
       }
@@ -481,6 +491,7 @@
     Iterable<SourceLibraryBuilder>? augmentationLibraries =
         this.augmentationLibraries;
     if (augmentationLibraries != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
         augmentationLibrary.buildOutlineNodes(coreLibrary);
       }
@@ -541,6 +552,7 @@
     Iterable<SourceLibraryBuilder>? augmentationLibraries =
         this.augmentationLibraries;
     if (augmentationLibraries != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
         // Augmentation libraries don't have their own export scope.
         augmentationLibrary.state =
@@ -558,6 +570,7 @@
     Iterable<SourceLibraryBuilder>? augmentationLibraries =
         this.augmentationLibraries;
     if (augmentationLibraries != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
         // Augmentation libraries don't have their own export scope.
         // TODO(johnniwinther): Do we need this?
@@ -638,6 +651,7 @@
     Iterable<SourceLibraryBuilder>? augmentationLibraries =
         this.augmentationLibraries;
     if (augmentationLibraries != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
         augmentationLibrary.buildNameSpace();
       }
@@ -669,6 +683,7 @@
     Iterable<SourceLibraryBuilder>? augmentationLibraries =
         this.augmentationLibraries;
     if (augmentationLibraries != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
         augmentationLibrary.buildScopes(coreLibrary);
       }
@@ -683,6 +698,7 @@
     }
 
     if (augmentationLibraries != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
         augmentationLibrary.applyAugmentations();
       }
@@ -700,6 +716,7 @@
     Iterable<SourceLibraryBuilder>? augmentationLibraries =
         this.augmentationLibraries;
     if (augmentationLibraries != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
         typeCount += augmentationLibrary.resolveTypes();
       }
@@ -719,6 +736,7 @@
     Iterable<SourceLibraryBuilder>? augmentationLibraries =
         this.augmentationLibraries;
     if (augmentationLibraries != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
         augmentationLibrary.installDefaultSupertypes(
             objectClassBuilder, objectClass);
@@ -738,6 +756,7 @@
     Iterable<SourceLibraryBuilder>? augmentationLibraries =
         this.augmentationLibraries;
     if (augmentationLibraries != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
         augmentationLibrary.collectSourceClassesAndExtensionTypes(
             sourceClasses, sourceExtensionTypes);
@@ -764,6 +783,7 @@
     Iterable<SourceLibraryBuilder>? augmentationLibraries =
         this.augmentationLibraries;
     if (augmentationLibraries != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
         count += augmentationLibrary.resolveConstructors();
       }
@@ -982,6 +1002,7 @@
     Iterable<SourceLibraryBuilder>? augmentationLibraries =
         this.augmentationLibraries;
     if (augmentationLibraries != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
         augmentationLibrary.takeMixinApplications(mixinApplications);
       }
@@ -997,6 +1018,7 @@
     Iterable<SourceLibraryBuilder>? augmentationLibraries =
         this.augmentationLibraries;
     if (augmentationLibraries != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
         augmentationLibrary.buildOutlineExpressions(
             classHierarchy, delayedDefaultValueCloners);
@@ -1136,6 +1158,7 @@
           !declaration.isDuplicate &&
           !declaration.isConflictingSetter) {
         if (declaration.isConflictingAugmentationMember) {
+          // Coverage-ignore-block(suite): Not run.
           member.name = new Name(
               '${member.name.text}'
               '#${declaration.libraryBuilder.augmentationIndex}',
@@ -1163,6 +1186,7 @@
     Iterable<SourceLibraryBuilder>? augmentationLibraries =
         this.augmentationLibraries;
     if (augmentationLibraries != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
         total += augmentationLibrary.finishDeferredLoadTearOffs();
       }
@@ -1181,6 +1205,7 @@
     Iterable<SourceLibraryBuilder>? augmentationLibraries =
         this.augmentationLibraries;
     if (augmentationLibraries != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
         count += augmentationLibrary.finishForwarders();
       }
@@ -1240,6 +1265,7 @@
     Iterable<SourceLibraryBuilder>? augmentationLibraries =
         this.augmentationLibraries;
     if (augmentationLibraries != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
         count += augmentationLibrary.finishNativeMethods();
       }
@@ -1268,6 +1294,7 @@
     Iterable<SourceLibraryBuilder>? augmentationLibraries =
         this.augmentationLibraries;
     if (augmentationLibraries != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
         augmentationLibrary.collectUnboundTypeParameters(
             nominalParameters, structuralParameters);
@@ -1302,6 +1329,7 @@
     Iterable<SourceLibraryBuilder>? augmentationLibraries =
         this.augmentationLibraries;
     if (augmentationLibraries != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
         count += augmentationLibrary.computeVariances();
       }
@@ -1326,6 +1354,7 @@
     Iterable<SourceLibraryBuilder>? augmentationLibraries =
         this.augmentationLibraries;
     if (augmentationLibraries != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
         count += augmentationLibrary.computeDefaultTypes(
             dynamicType, nullType, bottomType, objectClass);
@@ -1339,12 +1368,12 @@
     return count;
   }
 
+  // Coverage-ignore(suite): Not run.
   /// If this is an augmentation library, apply its augmentations to [origin].
   void applyAugmentations() {
     if (!isAugmenting) return;
 
     if (_languageVersion != origin._languageVersion) {
-      // Coverage-ignore-block(suite): Not run.
       List<LocatedMessage> context = <LocatedMessage>[];
       if (origin._languageVersion.isExplicit) {
         context.add(messageLanguageVersionLibraryContext.withLocation(
@@ -1379,6 +1408,7 @@
     Iterable<SourceLibraryBuilder>? augmentationLibraries =
         this.augmentationLibraries;
     if (augmentationLibraries != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
         count += augmentationLibrary.buildBodyNodes();
       }
@@ -1388,13 +1418,14 @@
     while (iterator.moveNext()) {
       Builder builder = iterator.current;
       if (builder is SourceMemberBuilder) {
-        count += builder.buildBodyNodes((
-            {required Member member,
-            Member? tearOff,
-            required BuiltMemberKind kind}) {
+        count += builder.buildBodyNodes(
+            // Coverage-ignore(suite): Not run.
+            (
+                {required Member member,
+                Member? tearOff,
+                required BuiltMemberKind kind}) {
           _addMemberToLibrary(builder, member);
           if (tearOff != null) {
-            // Coverage-ignore-block(suite): Not run.
             _addMemberToLibrary(builder, tearOff);
           }
         });
@@ -1841,6 +1872,7 @@
     Iterable<SourceLibraryBuilder>? augmentationLibraries =
         this.augmentationLibraries;
     if (augmentationLibraries != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
         augmentationLibrary.checkTypesInOutline(typeEnvironment);
       }
@@ -2072,12 +2104,12 @@
     Iterable<SourceLibraryBuilder>? augmentationLibraries =
         this.augmentationLibraries;
     if (augmentationLibraries != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
         List<DelayedDefaultValueCloner>?
             augmentationLibraryDelayedDefaultValueCloners =
             augmentationLibrary.installTypedefTearOffs();
         if (augmentationLibraryDelayedDefaultValueCloners != null) {
-          // Coverage-ignore-block(suite): Not run.
           (delayedDefaultValueCloners ??= [])
               .addAll(augmentationLibraryDelayedDefaultValueCloners);
         }
@@ -2418,8 +2450,12 @@
 }
 
 class Part {
-  final int offset;
+  final Uri fileUri;
+  final int fileOffset;
   final CompilationUnit compilationUnit;
 
-  Part(this.offset, this.compilationUnit);
+  Part(
+      {required this.fileUri,
+      required this.fileOffset,
+      required this.compilationUnit});
 }
diff --git a/pkg/front_end/lib/src/source/source_loader.dart b/pkg/front_end/lib/src/source/source_loader.dart
index a7f0ff2..4bfa130 100644
--- a/pkg/front_end/lib/src/source/source_loader.dart
+++ b/pkg/front_end/lib/src/source/source_loader.dart
@@ -342,7 +342,6 @@
     _loadedLibraryBuilders[uri] = libraryBuilder;
   }
 
-  // Coverage-ignore(suite): Not run.
   LibraryBuilder? deregisterLoadedLibraryBuilder(Uri importUri) {
     LibraryBuilder? libraryBuilder = _loadedLibraryBuilders.remove(importUri);
     if (libraryBuilder != null) {
@@ -1245,6 +1244,7 @@
     Iterable<SourceLibraryBuilder>? augmentationLibraries =
         library.augmentationLibraries;
     if (augmentationLibraries != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
         await buildBody(augmentationLibrary);
       }
@@ -1425,24 +1425,6 @@
       library.includeParts(usedParts);
     }
 
-    List<SourceLibraryBuilder> augmentationLibraries = [];
-
-    // Create augmentation libraries now that normal libraries have been
-    // created.
-    for (SourceCompilationUnit compilationUnit
-        in augmentationCompilationUnits) {
-      SourceLibraryBuilder sourceLibraryBuilder =
-          compilationUnit.createLibrary();
-      // TODO(johnniwinther): Avoid creating a [SourceLibraryBuilder]
-      // for augmentation libraries.
-      augmentationLibraries.add(sourceLibraryBuilder);
-    }
-
-    // Include parts in augment libraries.
-    for (SourceLibraryBuilder library in augmentationLibraries) {
-      library.includeParts(usedParts);
-    }
-
     for (MapEntry<Uri, SourceCompilationUnit> entry in parts.entries) {
       Uri uri = entry.key;
       SourceCompilationUnit part = entry.value;
@@ -1461,28 +1443,9 @@
     }
     ticker.logMs("Resolved parts");
 
-    for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
-      _compilationUnits.remove(augmentationLibrary.fileUri);
-      augmentationLibrary.origin.addAugmentationLibrary(augmentationLibrary);
-    }
     _sourceLibraryBuilders = sourceLibraries;
     assert(
         _compilationUnits.values.every((compilationUnit) =>
-            !(compilationUnit is SourceCompilationUnit &&
-                compilationUnit.isAugmenting)),
-        "Augmentation library found in libraryBuilders: " +
-            _compilationUnits.values
-                .where((compilationUnit) =>
-                    !(compilationUnit is SourceCompilationUnit &&
-                        compilationUnit.isAugmenting))
-                .join(', ') +
-            ".");
-    assert(
-        sourceLibraries.every((library) => !library.isAugmenting),
-        "Augmentation library found in sourceLibraryBuilders: "
-        "${sourceLibraries.where((library) => library.isAugmenting)}.");
-    assert(
-        _compilationUnits.values.every((compilationUnit) =>
             compilationUnit.loader != this ||
             sourceLibraries.contains(compilationUnit.libraryBuilder)),
         "Source library not found in sourceLibraryBuilders:" +
@@ -2687,6 +2650,7 @@
     Iterable<SourceLibraryBuilder>? augmentationLibraries =
         libraryBuilder.augmentationLibraries;
     if (augmentationLibraries != null) {
+      // Coverage-ignore-block(suite): Not run.
       for (SourceLibraryBuilder augmentationLibrary in augmentationLibraries) {
         _checkMainMethods(augmentationLibrary, listOfString);
       }
diff --git a/pkg/front_end/lib/src/source/source_member_builder.dart b/pkg/front_end/lib/src/source/source_member_builder.dart
index 43a412c..b795bec 100644
--- a/pkg/front_end/lib/src/source/source_member_builder.dart
+++ b/pkg/front_end/lib/src/source/source_member_builder.dart
@@ -139,6 +139,7 @@
   }
 
   @override
+  // Coverage-ignore(suite): Not run.
   void set isConflictingAugmentationMember(bool value) {
     assert(_isConflictingAugmentationMember == null,
         '$this.isConflictingAugmentationMember has already been fixed.');
@@ -201,6 +202,7 @@
   final InferenceDataForTesting inferenceData = new InferenceDataForTesting();
 }
 
+// Coverage-ignore(suite): Not run.
 class AugmentSuperTarget {
   final SourceMemberBuilder declaration;
   final Member? readTarget;
diff --git a/pkg/front_end/lib/src/source/source_method_builder.dart b/pkg/front_end/lib/src/source/source_method_builder.dart
index 5b11390..fe31ba9 100644
--- a/pkg/front_end/lib/src/source/source_method_builder.dart
+++ b/pkg/front_end/lib/src/source/source_method_builder.dart
@@ -102,6 +102,7 @@
   Builder get parent => declarationBuilder ?? libraryBuilder;
 
   @override
+  // Coverage-ignore(suite): Not run.
   bool get isAugmentation => _modifiers.isAugment;
 
   @override
@@ -137,19 +138,25 @@
         invokeTarget as Annotatable,
       ];
 
+  // Coverage-ignore(suite): Not run.
   // TODO(johnniwinther): Remove this. This is only needed for detecting patches
   // and macro annotations and we should use the fragment directly once
   // augmentations are fragments.
   List<MetadataBuilder>? get metadata => _introductory.metadata;
 
   @override
-  void applyAugmentation(Builder augmentation) {
+  void addAugmentation(Builder augmentation) {
+    _addAugmentation(augmentation);
+  }
+
+  void _addAugmentation(Builder augmentation) {
     if (augmentation is SourceMethodBuilder) {
       if (checkAugmentation(
           augmentationLibraryBuilder: augmentation.libraryBuilder,
           origin: this,
           augmentation: augmentation)) {
         augmentation._origin = this;
+
         SourceMethodBuilder augmentedBuilder =
             _augmentations == null ? this : _augmentations!.last;
         augmentation._augmentedBuilder = augmentedBuilder;
@@ -167,6 +174,12 @@
   }
 
   @override
+  // Coverage-ignore(suite): Not run.
+  void applyAugmentation(Builder augmentation) {
+    _addAugmentation(augmentation);
+  }
+
+  @override
   SourceMethodBuilder get origin => _origin ?? this;
 
   bool get isAugmented {
@@ -182,13 +195,13 @@
 
   Map<SourceMethodBuilder, AugmentSuperTarget?> _augmentedMethods = {};
 
+  // Coverage-ignore(suite): Not run.
   AugmentSuperTarget? _createAugmentSuperTarget(
       SourceMethodBuilder? targetBuilder) {
     if (targetBuilder == null) return null;
 
     Procedure declaredMethod = targetBuilder._introductory.invokeTarget;
     if (declaredMethod.isAbstract || declaredMethod.isExternal) {
-      // Coverage-ignore-block(suite): Not run.
       return targetBuilder._augmentedBuilder != null
           ? _getAugmentSuperTarget(targetBuilder._augmentedBuilder!)
           : null;
@@ -212,12 +225,14 @@
         writeTarget: null);
   }
 
+  // Coverage-ignore(suite): Not run.
   AugmentSuperTarget? _getAugmentSuperTarget(SourceMethodBuilder augmentation) {
     return _augmentedMethods[augmentation] ??=
         _createAugmentSuperTarget(augmentation._augmentedBuilder);
   }
 
   @override
+  // Coverage-ignore(suite): Not run.
   AugmentSuperTarget? get augmentSuperTarget =>
       origin._getAugmentSuperTarget(this);
 
@@ -228,6 +243,7 @@
       void addAugmentedMethod(SourceMethodBuilder builder) {
         Procedure? augmentedMethod = builder._augmentedMethod;
         if (augmentedMethod != null) {
+          // Coverage-ignore-block(suite): Not run.
           augmentedMethod
             ..fileOffset = builder._introductory.invokeTarget.fileOffset
             ..fileEndOffset = builder._introductory.invokeTarget.fileEndOffset
@@ -257,6 +273,17 @@
         reference: _reference,
         tearOffReference: _tearOffReference,
         classTypeParameters: classBuilder?.cls.typeParameters);
+    List<SourceMethodBuilder>? augmentations = _augmentations;
+    if (augmentations != null) {
+      for (SourceMethodBuilder augmentation in augmentations) {
+        augmentation.buildOutlineNodes((
+            {required Member member,
+            Member? tearOff,
+            required BuiltMemberKind kind}) {
+          // Don't add augmentations.
+        });
+      }
+    }
   }
 
   bool hasBuiltOutlineExpressions = false;
@@ -269,6 +296,13 @@
           declarationBuilder, invokeTarget as Annotatable,
           isClassInstanceMember: isClassInstanceMember,
           createFileUriExpression: isAugmented);
+      List<SourceMethodBuilder>? augmentations = _augmentations;
+      if (augmentations != null) {
+        for (SourceMethodBuilder augmentation in augmentations) {
+          augmentation.buildOutlineExpressions(
+              classHierarchy, delayedDefaultValueCloners);
+        }
+      }
       hasBuiltOutlineExpressions = true;
     }
   }
@@ -322,8 +356,11 @@
   Name get memberName => _memberName.name;
 
   @override
-  Member? get readTarget =>
-      isAugmenting ? _origin!.readTarget : _introductory.readTarget;
+  Member? get readTarget => isAugmenting
+      ?
+      // Coverage-ignore(suite): Not run.
+      _origin!.readTarget
+      : _introductory.readTarget;
 
   @override
   // Coverage-ignore(suite): Not run.
@@ -350,7 +387,17 @@
   @override
   int computeDefaultTypes(ComputeDefaultTypeContext context,
       {required bool inErrorRecovery}) {
-    return _introductory.computeDefaultTypes(context);
+    int count = _introductory.computeDefaultTypes(context);
+    if (declarationBuilder == null) {
+      List<SourceMethodBuilder>? augmentations = _augmentations;
+      if (augmentations != null) {
+        for (SourceMethodBuilder augmentation in augmentations) {
+          count += augmentation.computeDefaultTypes(context,
+              inErrorRecovery: inErrorRecovery);
+        }
+      }
+    }
+    return count;
   }
 
   @override
diff --git a/pkg/front_end/lib/src/source/source_property_builder.dart b/pkg/front_end/lib/src/source/source_property_builder.dart
index 50ab4b8..7502585 100644
--- a/pkg/front_end/lib/src/source/source_property_builder.dart
+++ b/pkg/front_end/lib/src/source/source_property_builder.dart
@@ -130,6 +130,7 @@
   Builder get parent => declarationBuilder ?? libraryBuilder;
 
   @override
+  // Coverage-ignore(suite): Not run.
   bool get isAugmentation => _modifiers.isAugment;
 
   @override
@@ -163,18 +164,21 @@
           writeTarget as Annotatable
       ];
 
+  // Coverage-ignore(suite): Not run.
   // TODO(johnniwinther): Remove this. This is only needed for detecting patches
   // and macro annotations and we should use the fragment directly once
   // augmentations are fragments.
   List<MetadataBuilder>? get metadata =>
       _introductoryGetable?.metadata ??
-      _introductorySetable
-          // Coverage-ignore(suite): Not run.
-          ?.metadata ??
+      _introductorySetable?.metadata ??
       _introductoryField?.metadata;
 
   @override
-  void applyAugmentation(Builder augmentation) {
+  void addAugmentation(Builder augmentation) {
+    _addAugmentation(augmentation);
+  }
+
+  void _addAugmentation(Builder augmentation) {
     if (augmentation is SourcePropertyBuilder) {
       if (checkAugmentation(
           augmentationLibraryBuilder: augmentation.libraryBuilder,
@@ -182,8 +186,11 @@
           augmentation: augmentation)) {
         augmentation._origin = this;
         if (augmentation.isSetter) {
-          SourcePropertyBuilder augmentedBuilder =
-              _setterAugmentations == null ? this : _setterAugmentations!.last;
+          SourcePropertyBuilder augmentedBuilder = _setterAugmentations == null
+              ? this
+              :
+              // Coverage-ignore(suite): Not run.
+              _setterAugmentations!.last;
           augmentation._augmentedBuilder = augmentedBuilder;
           augmentation._augmentationIndex =
               augmentedBuilder._augmentationIndex + 1;
@@ -210,6 +217,12 @@
   }
 
   @override
+  // Coverage-ignore(suite): Not run.
+  void applyAugmentation(Builder augmentation) {
+    _addAugmentation(augmentation);
+  }
+
+  @override
   SourcePropertyBuilder get origin => _origin ?? this;
 
   bool get isAugmented {
@@ -234,6 +247,7 @@
 
   Map<SourcePropertyBuilder, AugmentSuperTarget?> _augmentedProcedures = {};
 
+  // Coverage-ignore(suite): Not run.
   AugmentSuperTarget? _createAugmentSuperTarget(
       SourcePropertyBuilder? targetBuilder) {
     if (targetBuilder == null) return null;
@@ -243,7 +257,6 @@
       if (declaredSetter == null) return null;
 
       if (declaredSetter.isAbstract || declaredSetter.isExternal) {
-        // Coverage-ignore-block(suite): Not run.
         return targetBuilder._augmentedBuilder != null
             ? _getAugmentSuperTarget(targetBuilder._augmentedBuilder!)
             : null;
@@ -272,7 +285,6 @@
       if (declaredGetter == null) return null;
 
       if (declaredGetter.isAbstract || declaredGetter.isExternal) {
-        // Coverage-ignore-block(suite): Not run.
         return targetBuilder._augmentedBuilder != null
             ? _getAugmentSuperTarget(targetBuilder._augmentedBuilder!)
             : null;
@@ -298,6 +310,7 @@
     }
   }
 
+  // Coverage-ignore(suite): Not run.
   AugmentSuperTarget? _getAugmentSuperTarget(
       SourcePropertyBuilder augmentation) {
     return _augmentedProcedures[augmentation] ??=
@@ -305,6 +318,7 @@
   }
 
   @override
+  // Coverage-ignore(suite): Not run.
   AugmentSuperTarget? get augmentSuperTarget =>
       origin._getAugmentSuperTarget(this);
 
@@ -315,6 +329,7 @@
       void addAugmentedProcedure(SourcePropertyBuilder builder) {
         Procedure? augmentedGetter = builder._augmentedGetter;
         if (augmentedGetter != null) {
+          // Coverage-ignore-block(suite): Not run.
           augmentedGetter
             ..fileOffset = builder._introductoryGetable!.readTarget.fileOffset
             ..fileEndOffset =
@@ -342,6 +357,7 @@
       void addAugmentedProcedure(SourcePropertyBuilder builder) {
         Procedure? augmentedSetter = builder._augmentedSetter;
         if (augmentedSetter != null) {
+          // Coverage-ignore-block(suite): Not run.
           augmentedSetter
             ..fileOffset = builder._introductorySetable!.writeTarget.fileOffset
             ..fileEndOffset =
@@ -378,6 +394,28 @@
     _introductorySetable?.buildOutlineNode(
         libraryBuilder, _nameScheme, f, _references as SetterReference,
         classTypeParameters: classBuilder?.cls.typeParameters);
+    List<SourcePropertyBuilder>? getterAugmentations = _getterAugmentations;
+    if (getterAugmentations != null) {
+      for (SourcePropertyBuilder augmentation in getterAugmentations) {
+        augmentation.buildOutlineNodes((
+            {required Member member,
+            Member? tearOff,
+            required BuiltMemberKind kind}) {
+          // Don't add augmentations.
+        });
+      }
+    }
+    List<SourcePropertyBuilder>? setterAugmentations = _setterAugmentations;
+    if (setterAugmentations != null) {
+      for (SourcePropertyBuilder augmentation in setterAugmentations) {
+        augmentation.buildOutlineNodes((
+            {required Member member,
+            Member? tearOff,
+            required BuiltMemberKind kind}) {
+          // Don't add augmentations.
+        });
+      }
+    }
   }
 
   bool hasBuiltOutlineExpressions = false;
@@ -405,6 +443,20 @@
           libraryBuilder, declarationBuilder, writeTarget as Annotatable,
           isClassInstanceMember: isClassInstanceMember,
           createFileUriExpression: isAugmented);
+      List<SourcePropertyBuilder>? getterAugmentations = _getterAugmentations;
+      if (getterAugmentations != null) {
+        for (SourcePropertyBuilder augmentation in getterAugmentations) {
+          augmentation.buildOutlineExpressions(
+              classHierarchy, delayedDefaultValueCloners);
+        }
+      }
+      List<SourcePropertyBuilder>? setterAugmentations = _setterAugmentations;
+      if (setterAugmentations != null) {
+        for (SourcePropertyBuilder augmentation in setterAugmentations) {
+          augmentation.buildOutlineExpressions(
+              classHierarchy, delayedDefaultValueCloners);
+        }
+      }
       hasBuiltOutlineExpressions = true;
     }
   }
@@ -536,6 +588,20 @@
     if (_introductorySetable != null) {
       count += _introductorySetable!.computeDefaultTypes(context);
     }
+    List<SourcePropertyBuilder>? getterAugmentations = _getterAugmentations;
+    if (getterAugmentations != null) {
+      for (SourcePropertyBuilder augmentation in getterAugmentations) {
+        count += augmentation.computeDefaultTypes(context,
+            inErrorRecovery: inErrorRecovery);
+      }
+    }
+    List<SourcePropertyBuilder>? setterAugmentations = _setterAugmentations;
+    if (setterAugmentations != null) {
+      for (SourcePropertyBuilder augmentation in setterAugmentations) {
+        count += augmentation.computeDefaultTypes(context,
+            inErrorRecovery: inErrorRecovery);
+      }
+    }
     return count;
   }
 
diff --git a/pkg/front_end/lib/src/source/type_parameter_scope_builder.dart b/pkg/front_end/lib/src/source/type_parameter_scope_builder.dart
index ea944d0..af206fd 100644
--- a/pkg/front_end/lib/src/source/type_parameter_scope_builder.dart
+++ b/pkg/front_end/lib/src/source/type_parameter_scope_builder.dart
@@ -32,6 +32,7 @@
 import 'source_factory_builder.dart';
 import 'source_library_builder.dart';
 import 'source_loader.dart';
+import 'source_member_builder.dart';
 import 'source_method_builder.dart';
 import 'source_property_builder.dart';
 import 'source_type_alias_builder.dart';
@@ -204,7 +205,6 @@
             }
           } else {
             if (fragmentName.isAugment) {
-              // Coverage-ignore-block(suite): Not run.
               // Example:
               //
               //    int get foo => 42;
@@ -760,7 +760,6 @@
   bool absorbFragment(
       ProblemReporting problemReporting, _FragmentName fragmentName) {
     if (fragmentName.isAugment) {
-      // Coverage-ignore-block(suite): Not run.
       if (fragmentName.kind == fragment.kind) {
         // Example:
         //
@@ -860,7 +859,6 @@
       void Function(Fragment, {bool conflictingSetter}) createBuilder) {
     createBuilder(fragment.fragment);
     for (_FragmentName fragmentName in augmentations) {
-      // Coverage-ignore-block(suite): Not run.
       createBuilder(fragmentName.fragment);
     }
   }
@@ -1229,7 +1227,8 @@
             fragment: fragment,
             reference: reference);
         builders.add(new _AddBuilder(fragment.name, typedefBuilder,
-            fragment.fileUri, fragment.nameOffset));
+            fragment.fileUri, fragment.nameOffset,
+            inPatch: fragment.enclosingCompilationUnit.isPatch));
         if (reference != null) {
           loader.buildersCreatedWithReferences[reference] = typedefBuilder;
         }
@@ -1250,8 +1249,9 @@
             classDeclaration: new RegularClassDeclaration(fragment));
         fragment.builder = classBuilder;
         fragment.bodyScope.declarationBuilder = classBuilder;
-        builders.add(new _AddBuilder(fragment.name, classBuilder,
-            fragment.fileUri, fragment.fileOffset));
+        builders.add(new _AddBuilder(
+            fragment.name, classBuilder, fragment.fileUri, fragment.fileOffset,
+            inPatch: fragment.enclosingCompilationUnit.isPatch));
         if (indexedClass != null) {
           loader.buildersCreatedWithReferences[indexedClass.reference] =
               classBuilder;
@@ -1275,8 +1275,9 @@
             classDeclaration: new MixinDeclaration(fragment));
         fragment.builder = mixinBuilder;
         fragment.bodyScope.declarationBuilder = mixinBuilder;
-        builders.add(new _AddBuilder(fragment.name, mixinBuilder,
-            fragment.fileUri, fragment.fileOffset));
+        builders.add(new _AddBuilder(
+            fragment.name, mixinBuilder, fragment.fileUri, fragment.fileOffset,
+            inPatch: fragment.enclosingCompilationUnit.isPatch));
         if (indexedClass != null) {
           loader.buildersCreatedWithReferences[indexedClass.reference] =
               mixinBuilder;
@@ -1313,8 +1314,9 @@
             classDeclaration: classDeclaration);
         mixinApplications[classBuilder] = mixin;
         fragment.builder = classBuilder;
-        builders.add(new _AddBuilder(fragment.name, classBuilder,
-            fragment.fileUri, fragment.nameOffset));
+        builders.add(new _AddBuilder(
+            fragment.name, classBuilder, fragment.fileUri, fragment.nameOffset,
+            inPatch: fragment.enclosingCompilationUnit.isPatch));
         if (referencesFromIndexedClass != null) {
           loader.buildersCreatedWithReferences[
               referencesFromIndexedClass.reference] = classBuilder;
@@ -1344,7 +1346,8 @@
         fragment.builder = enumBuilder;
         fragment.bodyScope.declarationBuilder = enumBuilder;
         builders.add(new _AddBuilder(
-            fragment.name, enumBuilder, fragment.fileUri, fragment.fileOffset));
+            fragment.name, enumBuilder, fragment.fileUri, fragment.fileOffset,
+            inPatch: fragment.enclosingCompilationUnit.isPatch));
         if (indexedClass != null) {
           loader.buildersCreatedWithReferences[indexedClass.reference] =
               enumBuilder;
@@ -1363,7 +1366,8 @@
             fragment: fragment,
             reference: reference);
         builders.add(new _AddBuilder(fragment.name, extensionBuilder,
-            fragment.fileUri, fragment.fileOffset));
+            fragment.fileUri, fragment.fileOffset,
+            inPatch: fragment.enclosingCompilationUnit.isPatch));
         if (reference != null) {
           loader.buildersCreatedWithReferences[reference] = extensionBuilder;
         }
@@ -1392,7 +1396,8 @@
             fragment.name,
             extensionTypeDeclarationBuilder,
             fragment.fileUri,
-            fragment.fileOffset));
+            fragment.fileOffset,
+            inPatch: fragment.enclosingCompilationUnit.isPatch));
       case FieldFragment():
         String name = fragment.name;
 
@@ -1436,7 +1441,9 @@
                 references: references);
         fragment.builder = propertyBuilder;
         builders.add(new _AddBuilder(fragment.name, propertyBuilder,
-            fragment.fileUri, fragment.nameOffset));
+            fragment.fileUri, fragment.nameOffset,
+            inPatch: fragment.enclosingDeclaration?.isPatch ??
+                fragment.enclosingCompilationUnit.isPatch));
         references.registerReference(loader, propertyBuilder);
       case GetterFragment():
         String name = fragment.name;
@@ -1458,6 +1465,7 @@
         indexedContainer ??= indexedLibrary;
 
         bool isAugmentation = enclosingLibraryBuilder.isAugmenting &&
+            // Coverage-ignore(suite): Not run.
             fragment.modifiers.isAugment;
 
         GetterReference references = new GetterReference(
@@ -1477,7 +1485,9 @@
         fragment.setBuilder(problemReporting, propertyBuilder,
             propertyEncodingStrategy, unboundNominalParameters);
         builders.add(new _AddBuilder(fragment.name, propertyBuilder,
-            fragment.fileUri, fragment.nameOffset));
+            fragment.fileUri, fragment.nameOffset,
+            inPatch: fragment.enclosingDeclaration?.isPatch ??
+                fragment.enclosingCompilationUnit.isPatch));
         references.registerReference(loader, propertyBuilder);
       case SetterFragment():
         String name = fragment.name;
@@ -1499,6 +1509,7 @@
         indexedContainer ??= indexedLibrary;
 
         bool isAugmentation = enclosingLibraryBuilder.isAugmenting &&
+            // Coverage-ignore(suite): Not run.
             fragment.modifiers.isAugment;
 
         SetterReference references = new SetterReference(
@@ -1518,7 +1529,9 @@
         fragment.setBuilder(problemReporting, propertyBuilder,
             propertyEncodingStrategy, unboundNominalParameters);
         builders.add(new _AddBuilder(fragment.name, propertyBuilder,
-            fragment.fileUri, fragment.nameOffset));
+            fragment.fileUri, fragment.nameOffset,
+            inPatch: fragment.enclosingDeclaration?.isPatch ??
+                fragment.enclosingCompilationUnit.isPatch));
         references.registerReference(loader, propertyBuilder);
         if (conflictingSetter) {
           propertyBuilder.isConflictingSetter = true;
@@ -1552,6 +1565,7 @@
         indexedContainer ??= indexedLibrary;
 
         bool isAugmentation = enclosingLibraryBuilder.isAugmenting &&
+            // Coverage-ignore(suite): Not run.
             fragment.modifiers.isAugment;
         if (indexedContainer != null && !isAugmentation) {
           Name nameToLookup =
@@ -1579,8 +1593,10 @@
             tearOffReference: tearOffReference);
         fragment.setBuilder(problemReporting, methodBuilder, encodingStrategy,
             unboundNominalParameters);
-        builders.add(new _AddBuilder(fragment.name, methodBuilder,
-            fragment.fileUri, fragment.nameOffset));
+        builders.add(new _AddBuilder(
+            fragment.name, methodBuilder, fragment.fileUri, fragment.nameOffset,
+            inPatch: fragment.enclosingDeclaration?.isPatch ??
+                fragment.enclosingCompilationUnit.isPatch));
         if (procedureReference != null) {
           loader.buildersCreatedWithReferences[procedureReference] =
               methodBuilder;
@@ -1614,7 +1630,10 @@
                 ?.builders;
             NominalParameterCopy? nominalVariableCopy =
                 NominalParameterCopy.copyTypeParameters(
-                    unboundNominalParameters, declarationBuilder.typeParameters,
+                    unboundNominalParameters: unboundNominalParameters,
+                    oldParameterBuilders: declarationBuilder.typeParameters,
+                    oldParameterFragments:
+                        fragment.enclosingDeclaration.typeParameters,
                     kind: TypeParameterKind.extensionSynthesized,
                     instanceTypeParameterAccess:
                         InstanceTypeParameterAccessState.Allowed);
@@ -1698,7 +1717,10 @@
                 ?.builders;
             NominalParameterCopy? nominalVariableCopy =
                 NominalParameterCopy.copyTypeParameters(
-                    unboundNominalParameters, declarationBuilder.typeParameters,
+                    unboundNominalParameters: unboundNominalParameters,
+                    oldParameterBuilders: declarationBuilder.typeParameters,
+                    oldParameterFragments:
+                        fragment.enclosingDeclaration.typeParameters,
                     kind: TypeParameterKind.extensionSynthesized,
                     instanceTypeParameterAccess:
                         InstanceTypeParameterAccessState.Allowed);
@@ -1733,7 +1755,8 @@
         }
         fragment.builder = constructorBuilder;
         builders.add(new _AddBuilder(fragment.name, constructorBuilder,
-            fragment.fileUri, fragment.fullNameOffset));
+            fragment.fileUri, fragment.fullNameOffset,
+            inPatch: fragment.enclosingDeclaration.isPatch));
 
         // TODO(johnniwinther): There is no way to pass the tear off reference
         //  here.
@@ -1767,7 +1790,10 @@
           case ExtensionTypeDeclarationBuilder():
             NominalParameterCopy? nominalVariableCopy =
                 NominalParameterCopy.copyTypeParameters(
-                    unboundNominalParameters, declarationBuilder.typeParameters,
+                    unboundNominalParameters: unboundNominalParameters,
+                    oldParameterBuilders: declarationBuilder.typeParameters,
+                    oldParameterFragments:
+                        fragment.enclosingDeclaration.typeParameters,
                     kind: TypeParameterKind.extensionSynthesized,
                     instanceTypeParameterAccess:
                         InstanceTypeParameterAccessState.Allowed);
@@ -1816,7 +1842,8 @@
         }
         fragment.builder = constructorBuilder;
         builders.add(new _AddBuilder(fragment.name, constructorBuilder,
-            fragment.fileUri, fragment.fileOffset));
+            fragment.fileUri, fragment.fileOffset,
+            inPatch: fragment.enclosingDeclaration.isPatch));
 
         // TODO(johnniwinther): There is no way to pass the tear off reference
         //  here.
@@ -1828,7 +1855,10 @@
         String name = fragment.name;
         NominalParameterCopy? nominalParameterCopy =
             NominalParameterCopy.copyTypeParameters(
-                unboundNominalParameters, declarationBuilder!.typeParameters,
+                unboundNominalParameters: unboundNominalParameters,
+                oldParameterBuilders: declarationBuilder!.typeParameters,
+                oldParameterFragments:
+                    fragment.enclosingDeclaration.typeParameters,
                 kind: TypeParameterKind.function,
                 instanceTypeParameterAccess:
                     InstanceTypeParameterAccessState.Allowed);
@@ -1903,7 +1933,8 @@
         }
         fragment.builder = factoryBuilder;
         builders.add(new _AddBuilder(fragment.name, factoryBuilder,
-            fragment.fileUri, fragment.fullNameOffset));
+            fragment.fileUri, fragment.fullNameOffset,
+            inPatch: fragment.enclosingDeclaration.isPatch));
         // TODO(johnniwinther): There is no way to pass the tear off reference
         //  here.
         if (procedureReference != null) {
@@ -1936,7 +1967,8 @@
                 references: references);
         fragment.builder = propertyBuilder;
         builders.add(new _AddBuilder(fragment.name, propertyBuilder,
-            fragment.fileUri, fragment.nameOffset));
+            fragment.fileUri, fragment.nameOffset,
+            inPatch: fragment.enclosingDeclaration.isPatch));
     }
   }
 
@@ -1966,6 +1998,12 @@
     _fragments.addAll(other._fragments);
   }
 
+  bool _allowInjectedPublicMember(
+      SourceLibraryBuilder enclosingLibraryBuilder, Builder newBuilder) {
+    return enclosingLibraryBuilder.importUri.isScheme("dart") &&
+        enclosingLibraryBuilder.importUri.path.startsWith("_");
+  }
+
   NameSpace toNameSpace({
     required SourceLibraryBuilder enclosingLibraryBuilder,
     required IndexedLibrary? indexedLibrary,
@@ -1982,8 +2020,11 @@
     NameSpace nameSpace = new NameSpaceImpl(
         getables: getables, setables: setables, extensions: extensions);
 
-    void _addBuilder(
-        String name, Builder declaration, Uri fileUri, int charOffset) {
+    void _addBuilder(_AddBuilder addBuilder) {
+      String name = addBuilder.name;
+      Builder declaration = addBuilder.declaration;
+      Uri fileUri = addBuilder.fileUri;
+      int charOffset = addBuilder.charOffset;
       if (declaration is SourceExtensionBuilder &&
           declaration.isUnnamedExtension) {
         extensions.add(declaration);
@@ -2014,6 +2055,49 @@
 
       if (existing == declaration) return;
 
+      if (declaration.isAugment) {
+        if (existing != null) {
+          existing.addAugmentation(declaration);
+          return;
+        } else {
+          if (addBuilder.inPatch) {
+            Message message;
+            if (declaration is SourceMemberBuilder) {
+              message = addBuilder.inPatch
+                  ? templateUnmatchedPatchLibraryMember.withArguments(name)
+                  :
+                  // Coverage-ignore(suite): Not run.
+                  templateUnmatchedAugmentationLibraryMember
+                      .withArguments(name);
+            } else if (declaration is SourceClassBuilder) {
+              message = addBuilder.inPatch
+                  ? templateUnmatchedPatchClass.withArguments(name)
+                  :
+                  // Coverage-ignore(suite): Not run.
+                  templateUnmatchedAugmentationClass.withArguments(name);
+            } else {
+              message = addBuilder.inPatch
+                  ? templateUnmatchedPatchDeclaration.withArguments(name)
+                  :
+                  // Coverage-ignore(suite): Not run.
+                  templateUnmatchedAugmentationDeclaration.withArguments(name);
+            }
+            problemReporting.addProblem(message, charOffset, noLength, fileUri);
+          }
+        }
+      }
+
+      if (addBuilder.inPatch &&
+          !name.startsWith('_') &&
+          !_allowInjectedPublicMember(enclosingLibraryBuilder, declaration)) {
+        problemReporting.addProblem(
+            templatePatchInjectionFailed.withArguments(
+                name, enclosingLibraryBuilder.importUri),
+            charOffset,
+            noLength,
+            fileUri);
+      }
+
       if (declaration.next != null &&
           // Coverage-ignore(suite): Not run.
           declaration.next != existing) {
@@ -2034,6 +2118,7 @@
         // output.
         extensions.add(declaration as SourceExtensionBuilder);
       } else if (declaration.isAugment) {
+        // Coverage-ignore-block(suite): Not run.
         if (existing != null) {
           if (declaration.isSetter) {
             (setterAugmentations[name] ??= []).add(declaration);
@@ -2064,8 +2149,7 @@
           indexedLibrary: indexedLibrary,
           containerType: ContainerType.Library);
       for (_AddBuilder addBuilder in addBuilders) {
-        _addBuilder(addBuilder.name, addBuilder.declaration, addBuilder.fileUri,
-            addBuilder.charOffset);
+        _addBuilder(addBuilder);
       }
     }
     return nameSpace;
@@ -2146,6 +2230,7 @@
   final DeclarationBuilderScope bodyScope;
   final List<Fragment> _fragments = [];
 
+  @override
   final List<TypeParameterFragment>? typeParameters;
 
   final NominalParameterNameSpace _nominalParameterNameSpace;
@@ -2196,8 +2281,10 @@
   final Builder declaration;
   final Uri fileUri;
   final int charOffset;
+  final bool inPatch;
 
-  _AddBuilder(this.name, this.declaration, this.fileUri, this.charOffset);
+  _AddBuilder(this.name, this.declaration, this.fileUri, this.charOffset,
+      {required this.inPatch});
 }
 
 class DeclarationNameSpaceBuilder {
@@ -2213,57 +2300,22 @@
   DeclarationNameSpaceBuilder._(
       this._name, this._nominalParameterNameSpace, this._fragments);
 
-  void _addBuilder(
-      ProblemReporting problemReporting,
-      Map<String, Builder> getables,
-      Map<String, MemberBuilder> setables,
-      Map<String, MemberBuilder> constructors,
-      _AddBuilder addBuilder) {
-    String name = addBuilder.name;
-    Builder declaration = addBuilder.declaration;
-    Uri fileUri = addBuilder.fileUri;
-    int charOffset = addBuilder.charOffset;
+  void includeBuilders(DeclarationNameSpaceBuilder other) {
+    _fragments.addAll(other._fragments);
+    other._fragments.clear();
+  }
 
-    bool isConstructor = declaration is FunctionBuilder &&
-        (declaration.isConstructor || declaration.isFactory);
-    if (!isConstructor && name == _name) {
-      problemReporting.addProblem(
-          messageMemberWithSameNameAsClass, charOffset, noLength, fileUri);
+  bool _allowInjectedPublicMember(
+      SourceLibraryBuilder enclosingLibraryBuilder, Builder newBuilder) {
+    if (enclosingLibraryBuilder.importUri.isScheme("dart") &&
+        enclosingLibraryBuilder.importUri.path.startsWith("_")) {
+      return true;
     }
-    Map<String, Builder> members = isConstructor
-        ? constructors
-        : (declaration.isSetter ? setables : getables);
-
-    Builder? existing = members[name];
-
-    if (existing == declaration) return;
-
-    if (declaration.next != null &&
-        // Coverage-ignore(suite): Not run.
-        declaration.next != existing) {
-      unexpected(
-          "${declaration.next!.fileUri}@${declaration.next!.fileOffset}",
-          "${existing?.fileUri}@${existing?.fileOffset}",
-          declaration.fileOffset,
-          declaration.fileUri);
+    if (newBuilder.isStatic) {
+      return _name.startsWith('_');
     }
-    declaration.next = existing;
-    if (isDuplicatedDeclaration(existing, declaration)) {
-      // Error reporting in [_computeBuildersFromFragments].
-      // TODO(johnniwinther): Avoid the use of [isDuplicatedDeclaration].
-    } else if (declaration.isAugment) {
-      // Coverage-ignore-block(suite): Not run.
-      if (existing != null) {
-        if (declaration.isSetter) {
-          // TODO(johnniwinther): Collection augment setables.
-        } else {
-          // TODO(johnniwinther): Collection augment getables.
-        }
-      } else {
-        // TODO(cstefantsova): Report an error.
-      }
-    }
-    members[name] = declaration;
+    // TODO(johnniwinther): Restrict the use of injected public class members.
+    return true;
   }
 
   void checkTypeParameterConflict(ProblemReporting _problemReporting,
@@ -2305,6 +2357,87 @@
       (fragmentsByName[fragment.name] ??= []).add(fragment);
     }
 
+    void _addBuilder(_AddBuilder addBuilder) {
+      String name = addBuilder.name;
+      Builder declaration = addBuilder.declaration;
+      Uri fileUri = addBuilder.fileUri;
+      int charOffset = addBuilder.charOffset;
+
+      bool isConstructor = declaration is FunctionBuilder &&
+          (declaration.isConstructor || declaration.isFactory);
+      if (!isConstructor && name == _name) {
+        problemReporting.addProblem(
+            messageMemberWithSameNameAsClass, charOffset, noLength, fileUri);
+      }
+      Map<String, Builder> members = isConstructor
+          ? constructors
+          : (declaration.isSetter ? setables : getables);
+
+      Builder? existing = members[name];
+
+      if (existing == declaration) return;
+
+      if (declaration.isAugment) {
+        if (existing != null) {
+          existing.addAugmentation(declaration);
+          return;
+        } else {
+          Message message;
+          if (declaration is SourceMemberBuilder) {
+            message = addBuilder.inPatch
+                ? templateUnmatchedPatchClassMember.withArguments(name)
+                :
+                // Coverage-ignore(suite): Not run.
+                templateUnmatchedAugmentationClassMember.withArguments(name);
+          } else {
+            // Coverage-ignore-block(suite): Not run.
+            message = addBuilder.inPatch
+                ? templateUnmatchedPatchDeclaration.withArguments(name)
+                : templateUnmatchedAugmentationDeclaration.withArguments(name);
+          }
+          problemReporting.addProblem(message, charOffset, noLength, fileUri);
+        }
+      }
+
+      if (addBuilder.inPatch &&
+          !name.startsWith('_') &&
+          !_allowInjectedPublicMember(enclosingLibraryBuilder, declaration)) {
+        problemReporting.addProblem(
+            templatePatchInjectionFailed.withArguments(
+                name, enclosingLibraryBuilder.importUri),
+            charOffset,
+            noLength,
+            fileUri);
+      }
+
+      if (declaration.next != null &&
+          // Coverage-ignore(suite): Not run.
+          declaration.next != existing) {
+        unexpected(
+            "${declaration.next!.fileUri}@${declaration.next!.fileOffset}",
+            "${existing?.fileUri}@${existing?.fileOffset}",
+            declaration.fileOffset,
+            declaration.fileUri);
+      }
+      declaration.next = existing;
+      if (isDuplicatedDeclaration(existing, declaration)) {
+        // Error reporting in [_computeBuildersFromFragments].
+        // TODO(johnniwinther): Avoid the use of [isDuplicatedDeclaration].
+      } else if (declaration.isAugment) {
+        // Coverage-ignore-block(suite): Not run.
+        if (existing != null) {
+          if (declaration.isSetter) {
+            // TODO(johnniwinther): Collection augment setables.
+          } else {
+            // TODO(johnniwinther): Collection augment getables.
+          }
+        } else {
+          // TODO(cstefantsova): Report an error.
+        }
+      }
+      members[name] = declaration;
+    }
+
     for (MapEntry<String, List<Fragment>> entry in fragmentsByName.entries) {
       List<_AddBuilder> addBuilders = [];
       _computeBuildersFromFragments(entry.key, entry.value,
@@ -2321,8 +2454,7 @@
           containerType: containerType,
           containerName: containerName);
       for (_AddBuilder addBuilder in addBuilders) {
-        _addBuilder(
-            problemReporting, getables, setables, constructors, addBuilder);
+        _addBuilder(addBuilder);
       }
     }
 
diff --git a/pkg/front_end/lib/src/type_inference/inference_visitor.dart b/pkg/front_end/lib/src/type_inference/inference_visitor.dart
index 93eed0e..27808a7 100644
--- a/pkg/front_end/lib/src/type_inference/inference_visitor.dart
+++ b/pkg/front_end/lib/src/type_inference/inference_visitor.dart
@@ -5542,6 +5542,7 @@
         isExpressionInvocation: false, isImplicitCall: false);
   }
 
+  // Coverage-ignore(suite): Not run.
   ExpressionInferenceResult visitAugmentSuperInvocation(
       AugmentSuperInvocation node, DartType typeContext) {
     Member member = node.target;
@@ -5581,7 +5582,6 @@
       return new ExpressionInferenceResult(
           result.inferredType, result.applyResult(invocation));
     } else {
-      // Coverage-ignore-block(suite): Not run.
       // TODO(johnniwinther): Handle augmentation of field with inferred types.
       TypeInferenceEngine.resolveInferenceNode(member, hierarchyBuilder);
       DartType receiverType = member.getterType;
@@ -8252,6 +8252,7 @@
     return new ExpressionInferenceResult(replacementType, replacement);
   }
 
+  // Coverage-ignore(suite): Not run.
   ExpressionInferenceResult visitAugmentSuperSet(
       AugmentSuperSet node, DartType typeContext) {
     Member member = node.target;
@@ -8262,11 +8263,8 @@
       ObjectAccessTarget target = new ObjectAccessTarget.interfaceMember(
           thisType!, member,
           hasNonObjectMemberAccess: true);
-      if (target.isInstanceMember ||
-          // Coverage-ignore(suite): Not run.
-          target.isObjectMember) {
+      if (target.isInstanceMember || target.isObjectMember) {
         if (instrumentation != null && receiverType == const DynamicType()) {
-          // Coverage-ignore-block(suite): Not run.
           instrumentation!.record(uriForInstrumentation, node.fileOffset,
               'target', new InstrumentationValueForMember(target.member!));
         }
@@ -8505,6 +8503,7 @@
     }
   }
 
+  // Coverage-ignore(suite): Not run.
   ExpressionInferenceResult visitAugmentSuperGet(
       AugmentSuperGet node, DartType typeContext) {
     Member member = node.target;
diff --git a/pkg/front_end/messages.status b/pkg/front_end/messages.status
index 4fd1fa0..caab337 100644
--- a/pkg/front_end/messages.status
+++ b/pkg/front_end/messages.status
@@ -943,6 +943,8 @@
 PatchClassTypeParametersMismatch/example: Fail
 PatchDeclarationMismatch/analyzerCode: Fail
 PatchDeclarationMismatch/example: Fail
+PatchExtensionTypeParametersMismatch/analyzerCode: Fail
+PatchExtensionTypeParametersMismatch/example: Fail
 PatchInjectionFailed/analyzerCode: Fail
 PatchInjectionFailed/example: Fail
 PatchNonExternal/analyzerCode: Fail
diff --git a/pkg/front_end/messages.yaml b/pkg/front_end/messages.yaml
index cd4ad46..3dd5aee 100644
--- a/pkg/front_end/messages.yaml
+++ b/pkg/front_end/messages.yaml
@@ -4168,6 +4168,13 @@
   problemMessage: "This is the origin class."
   severity: CONTEXT
 
+PatchExtensionTypeParametersMismatch:
+  problemMessage: "A patch extension must have the same number of type variables as its origin extension."
+
+PatchExtensionOrigin:
+  problemMessage: "This is the origin extension."
+  severity: CONTEXT
+
 PatchDeclarationMismatch:
   problemMessage: "This patch doesn't match origin declaration."
 
diff --git a/pkg/front_end/test/coverage_suite_expected.dart b/pkg/front_end/test/coverage_suite_expected.dart
index 6d9b53d..ec1472a 100644
--- a/pkg/front_end/test/coverage_suite_expected.dart
+++ b/pkg/front_end/test/coverage_suite_expected.dart
@@ -150,7 +150,7 @@
   ),
   // 100.0%.
   "package:front_end/src/base/incremental_compiler.dart": (
-    hitCount: 828,
+    hitCount: 850,
     missCount: 0,
   ),
   // 100.0%.
@@ -185,7 +185,7 @@
   ),
   // 100.0%.
   "package:front_end/src/base/modifiers.dart": (
-    hitCount: 130,
+    hitCount: 128,
     missCount: 0,
   ),
   // 100.0%.
@@ -210,7 +210,7 @@
   ),
   // 100.0%.
   "package:front_end/src/base/scope.dart": (
-    hitCount: 671,
+    hitCount: 455,
     missCount: 0,
   ),
   // 100.0%.
@@ -255,7 +255,7 @@
   ),
   // 100.0%.
   "package:front_end/src/builder/class_builder.dart": (
-    hitCount: 137,
+    hitCount: 135,
     missCount: 0,
   ),
   // 100.0%.
@@ -265,7 +265,7 @@
   ),
   // 100.0%.
   "package:front_end/src/builder/declaration_builder.dart": (
-    hitCount: 28,
+    hitCount: 26,
     missCount: 0,
   ),
   // 100.0%.
@@ -370,7 +370,7 @@
   ),
   // 100.0%.
   "package:front_end/src/builder/synthesized_type_builder.dart": (
-    hitCount: 124,
+    hitCount: 122,
     missCount: 0,
   ),
   // 100.0%.
@@ -465,12 +465,12 @@
   ),
   // 100.0%.
   "package:front_end/src/fragment/class.dart": (
-    hitCount: 6,
+    hitCount: 11,
     missCount: 0,
   ),
   // 100.0%.
   "package:front_end/src/fragment/class/declaration.dart": (
-    hitCount: 171,
+    hitCount: 168,
     missCount: 0,
   ),
   // 100.0%.
@@ -480,7 +480,7 @@
   ),
   // 100.0%.
   "package:front_end/src/fragment/constructor/declaration.dart": (
-    hitCount: 315,
+    hitCount: 312,
     missCount: 0,
   ),
   // 100.0%.
@@ -490,7 +490,7 @@
   ),
   // 100.0%.
   "package:front_end/src/fragment/enum.dart": (
-    hitCount: 10,
+    hitCount: 13,
     missCount: 0,
   ),
   // 100.0%.
@@ -500,12 +500,12 @@
   ),
   // 100.0%.
   "package:front_end/src/fragment/extension.dart": (
-    hitCount: 13,
+    hitCount: 18,
     missCount: 0,
   ),
   // 100.0%.
   "package:front_end/src/fragment/extension_type.dart": (
-    hitCount: 10,
+    hitCount: 13,
     missCount: 0,
   ),
   // 100.0%.
@@ -535,17 +535,17 @@
   ),
   // 100.0%.
   "package:front_end/src/fragment/getter.dart": (
-    hitCount: 537,
+    hitCount: 530,
     missCount: 0,
   ),
   // 100.0%.
   "package:front_end/src/fragment/method.dart": (
-    hitCount: 783,
+    hitCount: 781,
     missCount: 0,
   ),
   // 100.0%.
   "package:front_end/src/fragment/mixin.dart": (
-    hitCount: 6,
+    hitCount: 9,
     missCount: 0,
   ),
   // 100.0%.
@@ -560,7 +560,7 @@
   ),
   // 100.0%.
   "package:front_end/src/fragment/setter.dart": (
-    hitCount: 557,
+    hitCount: 550,
     missCount: 0,
   ),
   // 100.0%.
@@ -575,12 +575,12 @@
   ),
   // 100.0%.
   "package:front_end/src/fragment/util.dart": (
-    hitCount: 117,
+    hitCount: 127,
     missCount: 0,
   ),
   // 100.0%.
   "package:front_end/src/kernel/augmentation_lowering.dart": (
-    hitCount: 4,
+    hitCount: 0,
     missCount: 0,
   ),
   // 100.0%.
@@ -590,12 +590,12 @@
   ),
   // 100.0%.
   "package:front_end/src/kernel/body_builder.dart": (
-    hitCount: 7216,
+    hitCount: 7205,
     missCount: 0,
   ),
   // 100.0%.
   "package:front_end/src/kernel/body_builder_context.dart": (
-    hitCount: 289,
+    hitCount: 281,
     missCount: 0,
   ),
   // 100.0%.
@@ -650,7 +650,7 @@
   ),
   // 100.0%.
   "package:front_end/src/kernel/expression_generator.dart": (
-    hitCount: 2525,
+    hitCount: 2480,
     missCount: 0,
   ),
   // 100.0%.
@@ -720,7 +720,7 @@
   ),
   // 100.0%.
   "package:front_end/src/kernel/internal_ast.dart": (
-    hitCount: 571,
+    hitCount: 551,
     missCount: 0,
   ),
   // 100.0%.
@@ -740,7 +740,7 @@
   ),
   // 100.0%.
   "package:front_end/src/kernel/kernel_target.dart": (
-    hitCount: 1043,
+    hitCount: 1044,
     missCount: 0,
   ),
   // 100.0%.
@@ -810,17 +810,17 @@
   ),
   // 100.0%.
   "package:front_end/src/source/builder_factory.dart": (
-    hitCount: 63,
+    hitCount: 69,
     missCount: 0,
   ),
   // 100.0%.
   "package:front_end/src/source/class_declaration.dart": (
-    hitCount: 104,
+    hitCount: 110,
     missCount: 0,
   ),
   // 100.0%.
   "package:front_end/src/source/diet_listener.dart": (
-    hitCount: 647,
+    hitCount: 646,
     missCount: 0,
   ),
   // 100.0%.
@@ -840,7 +840,7 @@
   ),
   // 100.0%.
   "package:front_end/src/source/outline_builder.dart": (
-    hitCount: 2114,
+    hitCount: 2109,
     missCount: 0,
   ),
   // 100.0%.
@@ -850,7 +850,7 @@
   ),
   // 100.0%.
   "package:front_end/src/source/source_builder_factory.dart": (
-    hitCount: 1158,
+    hitCount: 1190,
     missCount: 0,
   ),
   // 100.0%.
@@ -860,17 +860,17 @@
   ),
   // 100.0%.
   "package:front_end/src/source/source_class_builder.dart": (
-    hitCount: 1402,
+    hitCount: 1399,
     missCount: 0,
   ),
   // 100.0%.
   "package:front_end/src/source/source_compilation_unit.dart": (
-    hitCount: 658,
+    hitCount: 674,
     missCount: 0,
   ),
   // 100.0%.
   "package:front_end/src/source/source_constructor_builder.dart": (
-    hitCount: 694,
+    hitCount: 699,
     missCount: 0,
   ),
   // 100.0%.
@@ -880,48 +880,48 @@
   ),
   // 100.0%.
   "package:front_end/src/source/source_extension_builder.dart": (
-    hitCount: 134,
+    hitCount: 159,
     missCount: 0,
   ),
   // 100.0%.
   "package:front_end/src/source/source_extension_type_declaration_builder.dart":
       (
-    hitCount: 511,
+    hitCount: 514,
     missCount: 0,
   ),
   // 100.0%.
   "package:front_end/src/source/source_factory_builder.dart": (
-    hitCount: 994,
+    hitCount: 1011,
     missCount: 0,
   ),
   // 100.0%.
   "package:front_end/src/source/source_function_builder.dart": (
-    hitCount: 47,
+    hitCount: 46,
     missCount: 0,
   ),
   // 100.0%.
   "package:front_end/src/source/source_library_builder.dart": (
-    hitCount: 1238,
+    hitCount: 1120,
     missCount: 0,
   ),
   // 100.0%.
   "package:front_end/src/source/source_loader.dart": (
-    hitCount: 1844,
+    hitCount: 1819,
     missCount: 0,
   ),
   // 100.0%.
   "package:front_end/src/source/source_member_builder.dart": (
-    hitCount: 14,
+    hitCount: 10,
     missCount: 0,
   ),
   // 100.0%.
   "package:front_end/src/source/source_method_builder.dart": (
-    hitCount: 279,
+    hitCount: 229,
     missCount: 0,
   ),
   // 100.0%.
   "package:front_end/src/source/source_property_builder.dart": (
-    hitCount: 767,
+    hitCount: 678,
     missCount: 0,
   ),
   // 100.0%.
@@ -941,7 +941,7 @@
   ),
   // 100.0%.
   "package:front_end/src/source/type_parameter_scope_builder.dart": (
-    hitCount: 1397,
+    hitCount: 1496,
     missCount: 0,
   ),
   // 100.0%.
@@ -976,7 +976,7 @@
   ),
   // 100.0%.
   "package:front_end/src/type_inference/inference_visitor.dart": (
-    hitCount: 8283,
+    hitCount: 8178,
     missCount: 0,
   ),
   // 100.0%.
diff --git a/pkg/front_end/test/spell_checking_list_code.txt b/pkg/front_end/test/spell_checking_list_code.txt
index b3c2dd3..2968e50 100644
--- a/pkg/front_end/test/spell_checking_list_code.txt
+++ b/pkg/front_end/test/spell_checking_list_code.txt
@@ -1472,6 +1472,7 @@
 redeclared
 redefine
 redirectee
+redirections
 redirector
 redo
 reevaluation
diff --git a/pkg/front_end/testcases/enhanced_parts/part_with_import_part.dart b/pkg/front_end/testcases/enhanced_parts/part_with_import_part.dart
index b47f2ed..76556ab 100644
--- a/pkg/front_end/testcases/enhanced_parts/part_with_import_part.dart
+++ b/pkg/front_end/testcases/enhanced_parts/part_with_import_part.dart
@@ -8,4 +8,4 @@
 
 method2() {
   foo(); // Ok
-}
\ No newline at end of file
+}
diff --git a/pkg/front_end/testcases/extensions/patch/main.dart.strong.expect b/pkg/front_end/testcases/extensions/patch/main.dart.strong.expect
index 7c4343c..2577995 100644
--- a/pkg/front_end/testcases/extensions/patch/main.dart.strong.expect
+++ b/pkg/front_end/testcases/extensions/patch/main.dart.strong.expect
@@ -1,12 +1,4 @@
 library;
-//
-// Problems in library:
-//
-// pkg/front_end/testcases/extensions/patch/main.dart:9:5: Error: The method 'method2' isn't defined for the class 'int'.
-// Try correcting the name to the name of an existing method, or defining a method named 'method2'.
-//   0.method2();
-//     ^^^^^^^
-//
 import self as self;
 import "dart:test" as test;
 
@@ -14,21 +6,10 @@
 
 static method test() → dynamic {
   test::IntExtension|method1(0);
-  invalid-expression "pkg/front_end/testcases/extensions/patch/main.dart:9:5: Error: The method 'method2' isn't defined for the class 'int'.
-Try correcting the name to the name of an existing method, or defining a method named 'method2'.
-  0.method2();
-    ^^^^^^^" in 0{<unresolved>}.method2();
+  test::IntExtension|method2(0);
 }
 
 library;
-//
-// Problems in library:
-//
-// pkg/front_end/testcases/extensions/patch/origin_lib.dart:11:5: Error: The method 'method2' isn't defined for the class 'int'.
-// Try correcting the name to the name of an existing method, or defining a method named 'method2'.
-//   0.method2();
-//     ^^^^^^^
-//
 import self as test;
 import "dart:_internal" as _in;
 import "dart:core" as core;
@@ -37,30 +18,47 @@
 
 @#C1
 extension IntExtension on core::int {
-  method method2 = test::IntExtension|method2;
-  method tearoff method2 = test::IntExtension|get#method2;
   method method1 = test::IntExtension|method1;
   method tearoff method1 = test::IntExtension|get#method1;
+  method method2 = test::IntExtension|method2;
+  method tearoff method2 = test::IntExtension|get#method2;
+}
+@#C1
+extension GenericExtension<T extends core::Object? = dynamic> on T% {
+  method method3 = test::GenericExtension|method3;
+  method tearoff method3 = test::GenericExtension|get#method3;
+  method method4 = test::GenericExtension|method4;
+  method tearoff method4 = test::GenericExtension|get#method4;
 }
 @#C1
 static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ IntExtension|method1(lowered final core::int #this) → core::int
   return 42;
 static extension-member method IntExtension|get#method1(lowered final core::int #this) → () → core::int
   return () → core::int => test::IntExtension|method1(#this);
+@#C1
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ GenericExtension|method3<T extends core::Object? = dynamic>(lowered final test::GenericExtension|method3::T% #this) → core::int
+  return 42;
+static extension-member method GenericExtension|get#method3<T extends core::Object? = dynamic>(lowered final test::GenericExtension|get#method3::T% #this) → () → core::int
+  return () → core::int => test::GenericExtension|method3<test::GenericExtension|get#method3::T%>(#this);
 static method method1() → dynamic {
   test::IntExtension|method1(0);
-  invalid-expression "pkg/front_end/testcases/extensions/patch/origin_lib.dart:11:5: Error: The method 'method2' isn't defined for the class 'int'.
-Try correcting the name to the name of an existing method, or defining a method named 'method2'.
-  0.method2();
-    ^^^^^^^" in 0{<unresolved>}.method2();
+  test::IntExtension|method2(0);
+  test::GenericExtension|method3<core::int>(0);
+  test::GenericExtension|method4<core::int>(0);
 }
 static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ IntExtension|method2(lowered final core::int #this) → core::int
   return 43;
 static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ IntExtension|get#method2(lowered final core::int #this) → () → core::int
   return () → core::int => test::IntExtension|method2(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ GenericExtension|method4<T extends core::Object? = dynamic>(lowered final test::GenericExtension|method4::T% #this) → core::int
+  return 43;
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ GenericExtension|get#method4<T extends core::Object? = dynamic>(lowered final test::GenericExtension|get#method4::T% #this) → () → core::int
+  return () → core::int => test::GenericExtension|method4<test::GenericExtension|get#method4::T%>(#this);
 static method /* from org-dartlang-testcase:///patch_lib.dart */ _method2() → dynamic {
   test::IntExtension|method1(0);
   test::IntExtension|method2(0);
+  test::GenericExtension|method3<core::int>(0);
+  test::GenericExtension|method4<core::int>(0);
 }
 
 constants  {
diff --git a/pkg/front_end/testcases/extensions/patch/main.dart.strong.modular.expect b/pkg/front_end/testcases/extensions/patch/main.dart.strong.modular.expect
index 7c4343c..2577995 100644
--- a/pkg/front_end/testcases/extensions/patch/main.dart.strong.modular.expect
+++ b/pkg/front_end/testcases/extensions/patch/main.dart.strong.modular.expect
@@ -1,12 +1,4 @@
 library;
-//
-// Problems in library:
-//
-// pkg/front_end/testcases/extensions/patch/main.dart:9:5: Error: The method 'method2' isn't defined for the class 'int'.
-// Try correcting the name to the name of an existing method, or defining a method named 'method2'.
-//   0.method2();
-//     ^^^^^^^
-//
 import self as self;
 import "dart:test" as test;
 
@@ -14,21 +6,10 @@
 
 static method test() → dynamic {
   test::IntExtension|method1(0);
-  invalid-expression "pkg/front_end/testcases/extensions/patch/main.dart:9:5: Error: The method 'method2' isn't defined for the class 'int'.
-Try correcting the name to the name of an existing method, or defining a method named 'method2'.
-  0.method2();
-    ^^^^^^^" in 0{<unresolved>}.method2();
+  test::IntExtension|method2(0);
 }
 
 library;
-//
-// Problems in library:
-//
-// pkg/front_end/testcases/extensions/patch/origin_lib.dart:11:5: Error: The method 'method2' isn't defined for the class 'int'.
-// Try correcting the name to the name of an existing method, or defining a method named 'method2'.
-//   0.method2();
-//     ^^^^^^^
-//
 import self as test;
 import "dart:_internal" as _in;
 import "dart:core" as core;
@@ -37,30 +18,47 @@
 
 @#C1
 extension IntExtension on core::int {
-  method method2 = test::IntExtension|method2;
-  method tearoff method2 = test::IntExtension|get#method2;
   method method1 = test::IntExtension|method1;
   method tearoff method1 = test::IntExtension|get#method1;
+  method method2 = test::IntExtension|method2;
+  method tearoff method2 = test::IntExtension|get#method2;
+}
+@#C1
+extension GenericExtension<T extends core::Object? = dynamic> on T% {
+  method method3 = test::GenericExtension|method3;
+  method tearoff method3 = test::GenericExtension|get#method3;
+  method method4 = test::GenericExtension|method4;
+  method tearoff method4 = test::GenericExtension|get#method4;
 }
 @#C1
 static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ IntExtension|method1(lowered final core::int #this) → core::int
   return 42;
 static extension-member method IntExtension|get#method1(lowered final core::int #this) → () → core::int
   return () → core::int => test::IntExtension|method1(#this);
+@#C1
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ GenericExtension|method3<T extends core::Object? = dynamic>(lowered final test::GenericExtension|method3::T% #this) → core::int
+  return 42;
+static extension-member method GenericExtension|get#method3<T extends core::Object? = dynamic>(lowered final test::GenericExtension|get#method3::T% #this) → () → core::int
+  return () → core::int => test::GenericExtension|method3<test::GenericExtension|get#method3::T%>(#this);
 static method method1() → dynamic {
   test::IntExtension|method1(0);
-  invalid-expression "pkg/front_end/testcases/extensions/patch/origin_lib.dart:11:5: Error: The method 'method2' isn't defined for the class 'int'.
-Try correcting the name to the name of an existing method, or defining a method named 'method2'.
-  0.method2();
-    ^^^^^^^" in 0{<unresolved>}.method2();
+  test::IntExtension|method2(0);
+  test::GenericExtension|method3<core::int>(0);
+  test::GenericExtension|method4<core::int>(0);
 }
 static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ IntExtension|method2(lowered final core::int #this) → core::int
   return 43;
 static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ IntExtension|get#method2(lowered final core::int #this) → () → core::int
   return () → core::int => test::IntExtension|method2(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ GenericExtension|method4<T extends core::Object? = dynamic>(lowered final test::GenericExtension|method4::T% #this) → core::int
+  return 43;
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ GenericExtension|get#method4<T extends core::Object? = dynamic>(lowered final test::GenericExtension|get#method4::T% #this) → () → core::int
+  return () → core::int => test::GenericExtension|method4<test::GenericExtension|get#method4::T%>(#this);
 static method /* from org-dartlang-testcase:///patch_lib.dart */ _method2() → dynamic {
   test::IntExtension|method1(0);
   test::IntExtension|method2(0);
+  test::GenericExtension|method3<core::int>(0);
+  test::GenericExtension|method4<core::int>(0);
 }
 
 constants  {
diff --git a/pkg/front_end/testcases/extensions/patch/main.dart.strong.outline.expect b/pkg/front_end/testcases/extensions/patch/main.dart.strong.outline.expect
index e514945..10e2048 100644
--- a/pkg/front_end/testcases/extensions/patch/main.dart.strong.outline.expect
+++ b/pkg/front_end/testcases/extensions/patch/main.dart.strong.outline.expect
@@ -15,26 +15,43 @@
 
 @_in::patch
 extension IntExtension on core::int {
-  method method2 = self2::IntExtension|method2;
-  method tearoff method2 = self2::IntExtension|get#method2;
   method method1 = self2::IntExtension|method1;
   method tearoff method1 = self2::IntExtension|get#method1;
+  method method2 = self2::IntExtension|method2;
+  method tearoff method2 = self2::IntExtension|get#method2;
+}
+@_in::patch
+extension GenericExtension<T extends core::Object? = dynamic> on T% {
+  method method3 = self2::GenericExtension|method3;
+  method tearoff method3 = self2::GenericExtension|get#method3;
+  method method4 = self2::GenericExtension|method4;
+  method tearoff method4 = self2::GenericExtension|get#method4;
 }
 @_in::patch
 external static extension-member method IntExtension|method1(lowered final core::int #this) → core::int;
 static extension-member method IntExtension|get#method1(lowered final core::int #this) → () → core::int
   return () → core::int => self2::IntExtension|method1(#this);
+@_in::patch
+external static extension-member method GenericExtension|method3<T extends core::Object? = dynamic>(lowered final self2::GenericExtension|method3::T% #this) → core::int;
+static extension-member method GenericExtension|get#method3<T extends core::Object? = dynamic>(lowered final self2::GenericExtension|get#method3::T% #this) → () → core::int
+  return () → core::int => self2::GenericExtension|method3<self2::GenericExtension|get#method3::T%>(#this);
 static method method1() → dynamic
   ;
 static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ IntExtension|method2(lowered final core::int #this) → core::int
   ;
 static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ IntExtension|get#method2(lowered final core::int #this) → () → core::int
   return () → core::int => self2::IntExtension|method2(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ GenericExtension|method4<T extends core::Object? = dynamic>(lowered final self2::GenericExtension|method4::T% #this) → core::int
+  ;
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ GenericExtension|get#method4<T extends core::Object? = dynamic>(lowered final self2::GenericExtension|get#method4::T% #this) → () → core::int
+  return () → core::int => self2::GenericExtension|method4<self2::GenericExtension|get#method4::T%>(#this);
 static method /* from org-dartlang-testcase:///patch_lib.dart */ _method2() → dynamic
   ;
 
 
 Extra constant evaluation status:
-Evaluated: StaticGet @ org-dartlang-testcase:///origin_lib.dart:9:2 -> InstanceConstant(const _Patch{})
-Evaluated: StaticGet @ org-dartlang-testcase:///origin_lib.dart:12:1 -> InstanceConstant(const _Patch{})
-Extra constant evaluation: evaluated: 8, effectively constant: 2
+Evaluated: StaticGet @ org-dartlang-testcase:///origin_lib.dart:5:63 -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ org-dartlang-testcase:///origin_lib.dart:7:5 -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ org-dartlang-testcase:///origin_lib.dart:6:26 -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ org-dartlang-testcase:///origin_lib.dart:7:51 -> InstanceConstant(const _Patch{})
+Extra constant evaluation: evaluated: 16, effectively constant: 4
diff --git a/pkg/front_end/testcases/extensions/patch/main.dart.strong.transformed.expect b/pkg/front_end/testcases/extensions/patch/main.dart.strong.transformed.expect
index 7c4343c..2577995 100644
--- a/pkg/front_end/testcases/extensions/patch/main.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/extensions/patch/main.dart.strong.transformed.expect
@@ -1,12 +1,4 @@
 library;
-//
-// Problems in library:
-//
-// pkg/front_end/testcases/extensions/patch/main.dart:9:5: Error: The method 'method2' isn't defined for the class 'int'.
-// Try correcting the name to the name of an existing method, or defining a method named 'method2'.
-//   0.method2();
-//     ^^^^^^^
-//
 import self as self;
 import "dart:test" as test;
 
@@ -14,21 +6,10 @@
 
 static method test() → dynamic {
   test::IntExtension|method1(0);
-  invalid-expression "pkg/front_end/testcases/extensions/patch/main.dart:9:5: Error: The method 'method2' isn't defined for the class 'int'.
-Try correcting the name to the name of an existing method, or defining a method named 'method2'.
-  0.method2();
-    ^^^^^^^" in 0{<unresolved>}.method2();
+  test::IntExtension|method2(0);
 }
 
 library;
-//
-// Problems in library:
-//
-// pkg/front_end/testcases/extensions/patch/origin_lib.dart:11:5: Error: The method 'method2' isn't defined for the class 'int'.
-// Try correcting the name to the name of an existing method, or defining a method named 'method2'.
-//   0.method2();
-//     ^^^^^^^
-//
 import self as test;
 import "dart:_internal" as _in;
 import "dart:core" as core;
@@ -37,30 +18,47 @@
 
 @#C1
 extension IntExtension on core::int {
-  method method2 = test::IntExtension|method2;
-  method tearoff method2 = test::IntExtension|get#method2;
   method method1 = test::IntExtension|method1;
   method tearoff method1 = test::IntExtension|get#method1;
+  method method2 = test::IntExtension|method2;
+  method tearoff method2 = test::IntExtension|get#method2;
+}
+@#C1
+extension GenericExtension<T extends core::Object? = dynamic> on T% {
+  method method3 = test::GenericExtension|method3;
+  method tearoff method3 = test::GenericExtension|get#method3;
+  method method4 = test::GenericExtension|method4;
+  method tearoff method4 = test::GenericExtension|get#method4;
 }
 @#C1
 static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ IntExtension|method1(lowered final core::int #this) → core::int
   return 42;
 static extension-member method IntExtension|get#method1(lowered final core::int #this) → () → core::int
   return () → core::int => test::IntExtension|method1(#this);
+@#C1
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ GenericExtension|method3<T extends core::Object? = dynamic>(lowered final test::GenericExtension|method3::T% #this) → core::int
+  return 42;
+static extension-member method GenericExtension|get#method3<T extends core::Object? = dynamic>(lowered final test::GenericExtension|get#method3::T% #this) → () → core::int
+  return () → core::int => test::GenericExtension|method3<test::GenericExtension|get#method3::T%>(#this);
 static method method1() → dynamic {
   test::IntExtension|method1(0);
-  invalid-expression "pkg/front_end/testcases/extensions/patch/origin_lib.dart:11:5: Error: The method 'method2' isn't defined for the class 'int'.
-Try correcting the name to the name of an existing method, or defining a method named 'method2'.
-  0.method2();
-    ^^^^^^^" in 0{<unresolved>}.method2();
+  test::IntExtension|method2(0);
+  test::GenericExtension|method3<core::int>(0);
+  test::GenericExtension|method4<core::int>(0);
 }
 static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ IntExtension|method2(lowered final core::int #this) → core::int
   return 43;
 static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ IntExtension|get#method2(lowered final core::int #this) → () → core::int
   return () → core::int => test::IntExtension|method2(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ GenericExtension|method4<T extends core::Object? = dynamic>(lowered final test::GenericExtension|method4::T% #this) → core::int
+  return 43;
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ GenericExtension|get#method4<T extends core::Object? = dynamic>(lowered final test::GenericExtension|get#method4::T% #this) → () → core::int
+  return () → core::int => test::GenericExtension|method4<test::GenericExtension|get#method4::T%>(#this);
 static method /* from org-dartlang-testcase:///patch_lib.dart */ _method2() → dynamic {
   test::IntExtension|method1(0);
   test::IntExtension|method2(0);
+  test::GenericExtension|method3<core::int>(0);
+  test::GenericExtension|method4<core::int>(0);
 }
 
 constants  {
diff --git a/pkg/front_end/testcases/extensions/patch/origin_lib.dart b/pkg/front_end/testcases/extensions/patch/origin_lib.dart
index 1fa54b6..f6e5ce6 100644
--- a/pkg/front_end/testcases/extensions/patch/origin_lib.dart
+++ b/pkg/front_end/testcases/extensions/patch/origin_lib.dart
@@ -2,11 +2,46 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long long long long long long long long long long long long long long long
+// long comment to make offsets in `origin_lib.dart` out of range in
+// `patch_lib.dart`.
+
 extension IntExtension on int {
   external int method1();
 }
 
+extension GenericExtension<T> on T {
+  external int method3();
+}
+
 method1() {
   0.method1();
   0.method2();
+  0.method3();
+  0.method4();
 }
diff --git a/pkg/front_end/testcases/extensions/patch/patch_lib.dart b/pkg/front_end/testcases/extensions/patch/patch_lib.dart
index 98699a7..4a7bb94 100644
--- a/pkg/front_end/testcases/extensions/patch/patch_lib.dart
+++ b/pkg/front_end/testcases/extensions/patch/patch_lib.dart
@@ -13,7 +13,17 @@
   int method2() => 43;
 }
 
+@patch
+extension GenericExtension<T> on T {
+  @patch
+  int method3() => 42;
+
+  int method4() => 43;
+}
+
 _method2() {
   0.method1();
   0.method2();
+  0.method3();
+  0.method4();
 }
diff --git a/pkg/front_end/testcases/general/constructor_patch/main.dart.strong.expect b/pkg/front_end/testcases/general/constructor_patch/main.dart.strong.expect
index 082ffcc..35fd7d7 100644
--- a/pkg/front_end/testcases/general/constructor_patch/main.dart.strong.expect
+++ b/pkg/front_end/testcases/general/constructor_patch/main.dart.strong.expect
@@ -38,15 +38,6 @@
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C3
 class Class extends core::Object /*hasConstConstructor*/  {
   final field core::bool defaultValue /* from org-dartlang-testcase:///patch_lib.dart */;
-  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _privateInjected() → test::Class
-    : test::Class::defaultValue = false, super core::Object::•()
-    ;
-  constructor /* from org-dartlang-testcase:///patch_lib.dart */ redirect() → test::Class
-    : this test::Class::_private()
-    ;
-  constructor /* from org-dartlang-testcase:///patch_lib.dart */ redirectInjected() → test::Class
-    : this test::Class::_privateInjected()
-    ;
   @#C3
   constructor /* from org-dartlang-testcase:///patch_lib.dart */ generative({core::bool defaultValue = #C1}) → test::Class
     : test::Class::defaultValue = defaultValue, super core::Object::•()
@@ -59,11 +50,20 @@
   constructor /* from org-dartlang-testcase:///patch_lib.dart */ _private() → test::Class
     : test::Class::defaultValue = true, super core::Object::•()
     ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _privateInjected() → test::Class
+    : test::Class::defaultValue = false, super core::Object::•()
+    ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ redirect() → test::Class
+    : this test::Class::_private()
+    ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ redirectInjected() → test::Class
+    : this test::Class::_privateInjected()
+    ;
 }
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C3
 class Class2 extends core::Object {
-  final field core::int injectedField /* from org-dartlang-testcase:///patch_lib.dart */;
   field core::int field;
+  final field core::int injectedField /* from org-dartlang-testcase:///patch_lib.dart */;
   @#C3
   constructor /* from org-dartlang-testcase:///patch_lib.dart */ •(core::int field) → test::Class2
     : test::Class2::field = field, test::Class2::injectedField = field, super core::Object::•()
diff --git a/pkg/front_end/testcases/general/constructor_patch/main.dart.strong.modular.expect b/pkg/front_end/testcases/general/constructor_patch/main.dart.strong.modular.expect
index 082ffcc..35fd7d7 100644
--- a/pkg/front_end/testcases/general/constructor_patch/main.dart.strong.modular.expect
+++ b/pkg/front_end/testcases/general/constructor_patch/main.dart.strong.modular.expect
@@ -38,15 +38,6 @@
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C3
 class Class extends core::Object /*hasConstConstructor*/  {
   final field core::bool defaultValue /* from org-dartlang-testcase:///patch_lib.dart */;
-  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _privateInjected() → test::Class
-    : test::Class::defaultValue = false, super core::Object::•()
-    ;
-  constructor /* from org-dartlang-testcase:///patch_lib.dart */ redirect() → test::Class
-    : this test::Class::_private()
-    ;
-  constructor /* from org-dartlang-testcase:///patch_lib.dart */ redirectInjected() → test::Class
-    : this test::Class::_privateInjected()
-    ;
   @#C3
   constructor /* from org-dartlang-testcase:///patch_lib.dart */ generative({core::bool defaultValue = #C1}) → test::Class
     : test::Class::defaultValue = defaultValue, super core::Object::•()
@@ -59,11 +50,20 @@
   constructor /* from org-dartlang-testcase:///patch_lib.dart */ _private() → test::Class
     : test::Class::defaultValue = true, super core::Object::•()
     ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _privateInjected() → test::Class
+    : test::Class::defaultValue = false, super core::Object::•()
+    ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ redirect() → test::Class
+    : this test::Class::_private()
+    ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ redirectInjected() → test::Class
+    : this test::Class::_privateInjected()
+    ;
 }
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C3
 class Class2 extends core::Object {
-  final field core::int injectedField /* from org-dartlang-testcase:///patch_lib.dart */;
   field core::int field;
+  final field core::int injectedField /* from org-dartlang-testcase:///patch_lib.dart */;
   @#C3
   constructor /* from org-dartlang-testcase:///patch_lib.dart */ •(core::int field) → test::Class2
     : test::Class2::field = field, test::Class2::injectedField = field, super core::Object::•()
diff --git a/pkg/front_end/testcases/general/constructor_patch/main.dart.strong.outline.expect b/pkg/front_end/testcases/general/constructor_patch/main.dart.strong.outline.expect
index 1a2158e..c444a46 100644
--- a/pkg/front_end/testcases/general/constructor_patch/main.dart.strong.outline.expect
+++ b/pkg/front_end/testcases/general/constructor_patch/main.dart.strong.outline.expect
@@ -18,12 +18,6 @@
 @/* from org-dartlang-testcase:///patch_lib.dart */ _in::patch
 class Class extends core::Object /*hasConstConstructor*/  {
   final field core::bool defaultValue /* from org-dartlang-testcase:///patch_lib.dart */;
-  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _privateInjected() → self2::Class
-    ;
-  constructor /* from org-dartlang-testcase:///patch_lib.dart */ redirect() → self2::Class
-    ;
-  constructor /* from org-dartlang-testcase:///patch_lib.dart */ redirectInjected() → self2::Class
-    ;
   @_in::patch
   external constructor generative({core::bool defaultValue = true}) → self2::Class;
   @_in::patch
@@ -32,11 +26,17 @@
     ;
   @_in::patch
   external constructor _private() → self2::Class;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _privateInjected() → self2::Class
+    ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ redirect() → self2::Class
+    ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ redirectInjected() → self2::Class
+    ;
 }
 @/* from org-dartlang-testcase:///patch_lib.dart */ _in::patch
 class Class2 extends core::Object {
-  final field core::int injectedField /* from org-dartlang-testcase:///patch_lib.dart */;
   field core::int field;
+  final field core::int injectedField /* from org-dartlang-testcase:///patch_lib.dart */;
   @_in::patch
   external constructor •(core::int field) → self2::Class2;
 }
diff --git a/pkg/front_end/testcases/general/constructor_patch/main.dart.strong.transformed.expect b/pkg/front_end/testcases/general/constructor_patch/main.dart.strong.transformed.expect
index 082ffcc..35fd7d7 100644
--- a/pkg/front_end/testcases/general/constructor_patch/main.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/constructor_patch/main.dart.strong.transformed.expect
@@ -38,15 +38,6 @@
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C3
 class Class extends core::Object /*hasConstConstructor*/  {
   final field core::bool defaultValue /* from org-dartlang-testcase:///patch_lib.dart */;
-  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _privateInjected() → test::Class
-    : test::Class::defaultValue = false, super core::Object::•()
-    ;
-  constructor /* from org-dartlang-testcase:///patch_lib.dart */ redirect() → test::Class
-    : this test::Class::_private()
-    ;
-  constructor /* from org-dartlang-testcase:///patch_lib.dart */ redirectInjected() → test::Class
-    : this test::Class::_privateInjected()
-    ;
   @#C3
   constructor /* from org-dartlang-testcase:///patch_lib.dart */ generative({core::bool defaultValue = #C1}) → test::Class
     : test::Class::defaultValue = defaultValue, super core::Object::•()
@@ -59,11 +50,20 @@
   constructor /* from org-dartlang-testcase:///patch_lib.dart */ _private() → test::Class
     : test::Class::defaultValue = true, super core::Object::•()
     ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _privateInjected() → test::Class
+    : test::Class::defaultValue = false, super core::Object::•()
+    ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ redirect() → test::Class
+    : this test::Class::_private()
+    ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ redirectInjected() → test::Class
+    : this test::Class::_privateInjected()
+    ;
 }
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C3
 class Class2 extends core::Object {
-  final field core::int injectedField /* from org-dartlang-testcase:///patch_lib.dart */;
   field core::int field;
+  final field core::int injectedField /* from org-dartlang-testcase:///patch_lib.dart */;
   @#C3
   constructor /* from org-dartlang-testcase:///patch_lib.dart */ •(core::int field) → test::Class2
     : test::Class2::field = field, test::Class2::injectedField = field, super core::Object::•()
diff --git a/pkg/front_end/testcases/general/inject_public/main.dart.strong.expect b/pkg/front_end/testcases/general/inject_public/main.dart.strong.expect
index 46edd73..4394326 100644
--- a/pkg/front_end/testcases/general/inject_public/main.dart.strong.expect
+++ b/pkg/front_end/testcases/general/inject_public/main.dart.strong.expect
@@ -19,33 +19,85 @@
 //
 // pkg/front_end/testcases/general/inject_public/patch_lib.dart:8:7: Error: Can't inject public 'InjectedClass' into 'dart:test'.
 // Make 'InjectedClass' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
-// class InjectedClass {}
+// class InjectedClass {} // Error
 //       ^
 //
 // pkg/front_end/testcases/general/inject_public/patch_lib.dart:10:1: Error: Can't inject public 'injectedMethod' into 'dart:test'.
 // Make 'injectedMethod' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
-// injectedMethod() {}
+// injectedMethod() {} // Error
 // ^
 //
+// pkg/front_end/testcases/general/inject_public/patch_lib.dart:15:10: Error: Can't inject public 'staticInjectedMethod' into 'dart:test'.
+// Make 'staticInjectedMethod' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+//   static staticInjectedMethod() {} // Error
+//          ^
+//
+// pkg/front_end/testcases/general/inject_public/patch_lib.dart:21:10: Error: Can't inject public 'staticInjectedMethod' into 'dart:test'.
+// Make 'staticInjectedMethod' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+//   static staticInjectedMethod() {} // Error
+//          ^
+//
 import self as test;
-import "dart:core" as core;
 import "dart:_internal" as _in;
+import "dart:core" as core;
 
 import "dart:_internal";
 
-class InjectedClass extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
-  synthetic constructor •() → test::InjectedClass
-    : super core::Object::•()
-    ;
-}
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C1
 class Class extends core::Object {
   synthetic constructor •() → test::Class
     : super core::Object::•()
     ;
   method /* from org-dartlang-testcase:///patch_lib.dart */ injectedMethod() → dynamic {}
+  static method /* from org-dartlang-testcase:///patch_lib.dart */ staticInjectedMethod() → dynamic {}
+}
+@/* from org-dartlang-testcase:///patch_lib.dart */ #C1
+class _PrivateClass extends core::Object {
+  synthetic constructor •() → test::_PrivateClass
+    : super core::Object::•()
+    ;
+  method /* from org-dartlang-testcase:///patch_lib.dart */ injectedMethod() → dynamic {}
+  static method /* from org-dartlang-testcase:///patch_lib.dart */ staticInjectedMethod() → dynamic {}
+}
+class InjectedClass extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  synthetic constructor •() → test::InjectedClass
+    : super core::Object::•()
+    ;
+}
+class _PrivateInjectedClass extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  synthetic constructor •() → test::_PrivateInjectedClass
+    : super core::Object::•()
+    ;
+  method publicMethod() → dynamic {}
+}
+@#C1
+extension Extension on core::int {
+  method injectedMethod = test::Extension|injectedMethod;
+  method tearoff injectedMethod = test::Extension|get#injectedMethod;
+  static method staticInjectedMethod = test::Extension|staticInjectedMethod;
+}
+@#C1
+extension _PrivateExtension on core::int {
+  method injectedMethod = test::_PrivateExtension|injectedMethod;
+  method tearoff injectedMethod = test::_PrivateExtension|get#injectedMethod;
+  static method staticInjectedMethod = test::_PrivateExtension|staticInjectedMethod;
+}
+extension _PrivateInjectedExtension on core::int { // from org-dartlang-testcase:///patch_lib.dart
+  method publicMethod = test::_PrivateInjectedExtension|publicMethod;
+  method tearoff publicMethod = test::_PrivateInjectedExtension|get#publicMethod;
 }
 static method /* from org-dartlang-testcase:///patch_lib.dart */ injectedMethod() → dynamic {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|injectedMethod(lowered final core::int #this) → dynamic {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|get#injectedMethod(lowered final core::int #this) → () → dynamic
+  return () → dynamic => test::Extension|injectedMethod(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|staticInjectedMethod() → dynamic {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ _PrivateInjectedExtension|publicMethod(lowered final core::int #this) → dynamic {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ _PrivateInjectedExtension|get#publicMethod(lowered final core::int #this) → () → dynamic
+  return () → dynamic => test::_PrivateInjectedExtension|publicMethod(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ _PrivateExtension|injectedMethod(lowered final core::int #this) → dynamic {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ _PrivateExtension|get#injectedMethod(lowered final core::int #this) → () → dynamic
+  return () → dynamic => test::_PrivateExtension|injectedMethod(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ _PrivateExtension|staticInjectedMethod() → dynamic {}
 
 constants  {
   #C1 = _in::_Patch {}
diff --git a/pkg/front_end/testcases/general/inject_public/main.dart.strong.modular.expect b/pkg/front_end/testcases/general/inject_public/main.dart.strong.modular.expect
index 46edd73..4394326 100644
--- a/pkg/front_end/testcases/general/inject_public/main.dart.strong.modular.expect
+++ b/pkg/front_end/testcases/general/inject_public/main.dart.strong.modular.expect
@@ -19,33 +19,85 @@
 //
 // pkg/front_end/testcases/general/inject_public/patch_lib.dart:8:7: Error: Can't inject public 'InjectedClass' into 'dart:test'.
 // Make 'InjectedClass' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
-// class InjectedClass {}
+// class InjectedClass {} // Error
 //       ^
 //
 // pkg/front_end/testcases/general/inject_public/patch_lib.dart:10:1: Error: Can't inject public 'injectedMethod' into 'dart:test'.
 // Make 'injectedMethod' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
-// injectedMethod() {}
+// injectedMethod() {} // Error
 // ^
 //
+// pkg/front_end/testcases/general/inject_public/patch_lib.dart:15:10: Error: Can't inject public 'staticInjectedMethod' into 'dart:test'.
+// Make 'staticInjectedMethod' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+//   static staticInjectedMethod() {} // Error
+//          ^
+//
+// pkg/front_end/testcases/general/inject_public/patch_lib.dart:21:10: Error: Can't inject public 'staticInjectedMethod' into 'dart:test'.
+// Make 'staticInjectedMethod' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+//   static staticInjectedMethod() {} // Error
+//          ^
+//
 import self as test;
-import "dart:core" as core;
 import "dart:_internal" as _in;
+import "dart:core" as core;
 
 import "dart:_internal";
 
-class InjectedClass extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
-  synthetic constructor •() → test::InjectedClass
-    : super core::Object::•()
-    ;
-}
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C1
 class Class extends core::Object {
   synthetic constructor •() → test::Class
     : super core::Object::•()
     ;
   method /* from org-dartlang-testcase:///patch_lib.dart */ injectedMethod() → dynamic {}
+  static method /* from org-dartlang-testcase:///patch_lib.dart */ staticInjectedMethod() → dynamic {}
+}
+@/* from org-dartlang-testcase:///patch_lib.dart */ #C1
+class _PrivateClass extends core::Object {
+  synthetic constructor •() → test::_PrivateClass
+    : super core::Object::•()
+    ;
+  method /* from org-dartlang-testcase:///patch_lib.dart */ injectedMethod() → dynamic {}
+  static method /* from org-dartlang-testcase:///patch_lib.dart */ staticInjectedMethod() → dynamic {}
+}
+class InjectedClass extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  synthetic constructor •() → test::InjectedClass
+    : super core::Object::•()
+    ;
+}
+class _PrivateInjectedClass extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  synthetic constructor •() → test::_PrivateInjectedClass
+    : super core::Object::•()
+    ;
+  method publicMethod() → dynamic {}
+}
+@#C1
+extension Extension on core::int {
+  method injectedMethod = test::Extension|injectedMethod;
+  method tearoff injectedMethod = test::Extension|get#injectedMethod;
+  static method staticInjectedMethod = test::Extension|staticInjectedMethod;
+}
+@#C1
+extension _PrivateExtension on core::int {
+  method injectedMethod = test::_PrivateExtension|injectedMethod;
+  method tearoff injectedMethod = test::_PrivateExtension|get#injectedMethod;
+  static method staticInjectedMethod = test::_PrivateExtension|staticInjectedMethod;
+}
+extension _PrivateInjectedExtension on core::int { // from org-dartlang-testcase:///patch_lib.dart
+  method publicMethod = test::_PrivateInjectedExtension|publicMethod;
+  method tearoff publicMethod = test::_PrivateInjectedExtension|get#publicMethod;
 }
 static method /* from org-dartlang-testcase:///patch_lib.dart */ injectedMethod() → dynamic {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|injectedMethod(lowered final core::int #this) → dynamic {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|get#injectedMethod(lowered final core::int #this) → () → dynamic
+  return () → dynamic => test::Extension|injectedMethod(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|staticInjectedMethod() → dynamic {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ _PrivateInjectedExtension|publicMethod(lowered final core::int #this) → dynamic {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ _PrivateInjectedExtension|get#publicMethod(lowered final core::int #this) → () → dynamic
+  return () → dynamic => test::_PrivateInjectedExtension|publicMethod(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ _PrivateExtension|injectedMethod(lowered final core::int #this) → dynamic {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ _PrivateExtension|get#injectedMethod(lowered final core::int #this) → () → dynamic
+  return () → dynamic => test::_PrivateExtension|injectedMethod(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ _PrivateExtension|staticInjectedMethod() → dynamic {}
 
 constants  {
   #C1 = _in::_Patch {}
diff --git a/pkg/front_end/testcases/general/inject_public/main.dart.strong.outline.expect b/pkg/front_end/testcases/general/inject_public/main.dart.strong.outline.expect
index 8154ebc..a34b2d0 100644
--- a/pkg/front_end/testcases/general/inject_public/main.dart.strong.outline.expect
+++ b/pkg/front_end/testcases/general/inject_public/main.dart.strong.outline.expect
@@ -14,35 +14,97 @@
 //
 // pkg/front_end/testcases/general/inject_public/patch_lib.dart:8:7: Error: Can't inject public 'InjectedClass' into 'dart:test'.
 // Make 'InjectedClass' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
-// class InjectedClass {}
+// class InjectedClass {} // Error
 //       ^
 //
 // pkg/front_end/testcases/general/inject_public/patch_lib.dart:10:1: Error: Can't inject public 'injectedMethod' into 'dart:test'.
 // Make 'injectedMethod' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
-// injectedMethod() {}
+// injectedMethod() {} // Error
 // ^
 //
+// pkg/front_end/testcases/general/inject_public/patch_lib.dart:15:10: Error: Can't inject public 'staticInjectedMethod' into 'dart:test'.
+// Make 'staticInjectedMethod' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+//   static staticInjectedMethod() {} // Error
+//          ^
+//
+// pkg/front_end/testcases/general/inject_public/patch_lib.dart:21:10: Error: Can't inject public 'staticInjectedMethod' into 'dart:test'.
+// Make 'staticInjectedMethod' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+//   static staticInjectedMethod() {} // Error
+//          ^
+//
 import self as self2;
-import "dart:core" as core;
 import "dart:_internal" as _in;
+import "dart:core" as core;
 
 import "dart:_internal";
 
-class InjectedClass extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
-  synthetic constructor •() → self2::InjectedClass
-    ;
-}
 @/* from org-dartlang-testcase:///patch_lib.dart */ _in::patch
 class Class extends core::Object {
   synthetic constructor •() → self2::Class
     ;
   method /* from org-dartlang-testcase:///patch_lib.dart */ injectedMethod() → dynamic
     ;
+  static method /* from org-dartlang-testcase:///patch_lib.dart */ staticInjectedMethod() → dynamic
+    ;
+}
+@/* from org-dartlang-testcase:///patch_lib.dart */ _in::patch
+class _PrivateClass extends core::Object {
+  synthetic constructor •() → self2::_PrivateClass
+    ;
+  method /* from org-dartlang-testcase:///patch_lib.dart */ injectedMethod() → dynamic
+    ;
+  static method /* from org-dartlang-testcase:///patch_lib.dart */ staticInjectedMethod() → dynamic
+    ;
+}
+class InjectedClass extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  synthetic constructor •() → self2::InjectedClass
+    ;
+}
+class _PrivateInjectedClass extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  synthetic constructor •() → self2::_PrivateInjectedClass
+    ;
+  method publicMethod() → dynamic
+    ;
+}
+@_in::patch
+extension Extension on core::int {
+  method injectedMethod = self2::Extension|injectedMethod;
+  method tearoff injectedMethod = self2::Extension|get#injectedMethod;
+  static method staticInjectedMethod = self2::Extension|staticInjectedMethod;
+}
+@_in::patch
+extension _PrivateExtension on core::int {
+  method injectedMethod = self2::_PrivateExtension|injectedMethod;
+  method tearoff injectedMethod = self2::_PrivateExtension|get#injectedMethod;
+  static method staticInjectedMethod = self2::_PrivateExtension|staticInjectedMethod;
+}
+extension _PrivateInjectedExtension on core::int { // from org-dartlang-testcase:///patch_lib.dart
+  method publicMethod = self2::_PrivateInjectedExtension|publicMethod;
+  method tearoff publicMethod = self2::_PrivateInjectedExtension|get#publicMethod;
 }
 static method /* from org-dartlang-testcase:///patch_lib.dart */ injectedMethod() → dynamic
   ;
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|injectedMethod(lowered final core::int #this) → dynamic
+  ;
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|get#injectedMethod(lowered final core::int #this) → () → dynamic
+  return () → dynamic => self2::Extension|injectedMethod(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|staticInjectedMethod() → dynamic
+  ;
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ _PrivateInjectedExtension|publicMethod(lowered final core::int #this) → dynamic
+  ;
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ _PrivateInjectedExtension|get#publicMethod(lowered final core::int #this) → () → dynamic
+  return () → dynamic => self2::_PrivateInjectedExtension|publicMethod(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ _PrivateExtension|injectedMethod(lowered final core::int #this) → dynamic
+  ;
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ _PrivateExtension|get#injectedMethod(lowered final core::int #this) → () → dynamic
+  return () → dynamic => self2::_PrivateExtension|injectedMethod(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ _PrivateExtension|staticInjectedMethod() → dynamic
+  ;
 
 
 Extra constant evaluation status:
 Evaluated: FileUriExpression @ org-dartlang-testcase:///patch_lib.dart:12:1 -> InstanceConstant(const _Patch{})
-Extra constant evaluation: evaluated: 1, effectively constant: 1
+Evaluated: FileUriExpression @ org-dartlang-testcase:///patch_lib.dart:32:1 -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Extra constant evaluation: evaluated: 13, effectively constant: 4
diff --git a/pkg/front_end/testcases/general/inject_public/main.dart.strong.transformed.expect b/pkg/front_end/testcases/general/inject_public/main.dart.strong.transformed.expect
index 46edd73..4394326 100644
--- a/pkg/front_end/testcases/general/inject_public/main.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/inject_public/main.dart.strong.transformed.expect
@@ -19,33 +19,85 @@
 //
 // pkg/front_end/testcases/general/inject_public/patch_lib.dart:8:7: Error: Can't inject public 'InjectedClass' into 'dart:test'.
 // Make 'InjectedClass' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
-// class InjectedClass {}
+// class InjectedClass {} // Error
 //       ^
 //
 // pkg/front_end/testcases/general/inject_public/patch_lib.dart:10:1: Error: Can't inject public 'injectedMethod' into 'dart:test'.
 // Make 'injectedMethod' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
-// injectedMethod() {}
+// injectedMethod() {} // Error
 // ^
 //
+// pkg/front_end/testcases/general/inject_public/patch_lib.dart:15:10: Error: Can't inject public 'staticInjectedMethod' into 'dart:test'.
+// Make 'staticInjectedMethod' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+//   static staticInjectedMethod() {} // Error
+//          ^
+//
+// pkg/front_end/testcases/general/inject_public/patch_lib.dart:21:10: Error: Can't inject public 'staticInjectedMethod' into 'dart:test'.
+// Make 'staticInjectedMethod' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+//   static staticInjectedMethod() {} // Error
+//          ^
+//
 import self as test;
-import "dart:core" as core;
 import "dart:_internal" as _in;
+import "dart:core" as core;
 
 import "dart:_internal";
 
-class InjectedClass extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
-  synthetic constructor •() → test::InjectedClass
-    : super core::Object::•()
-    ;
-}
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C1
 class Class extends core::Object {
   synthetic constructor •() → test::Class
     : super core::Object::•()
     ;
   method /* from org-dartlang-testcase:///patch_lib.dart */ injectedMethod() → dynamic {}
+  static method /* from org-dartlang-testcase:///patch_lib.dart */ staticInjectedMethod() → dynamic {}
+}
+@/* from org-dartlang-testcase:///patch_lib.dart */ #C1
+class _PrivateClass extends core::Object {
+  synthetic constructor •() → test::_PrivateClass
+    : super core::Object::•()
+    ;
+  method /* from org-dartlang-testcase:///patch_lib.dart */ injectedMethod() → dynamic {}
+  static method /* from org-dartlang-testcase:///patch_lib.dart */ staticInjectedMethod() → dynamic {}
+}
+class InjectedClass extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  synthetic constructor •() → test::InjectedClass
+    : super core::Object::•()
+    ;
+}
+class _PrivateInjectedClass extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  synthetic constructor •() → test::_PrivateInjectedClass
+    : super core::Object::•()
+    ;
+  method publicMethod() → dynamic {}
+}
+@#C1
+extension Extension on core::int {
+  method injectedMethod = test::Extension|injectedMethod;
+  method tearoff injectedMethod = test::Extension|get#injectedMethod;
+  static method staticInjectedMethod = test::Extension|staticInjectedMethod;
+}
+@#C1
+extension _PrivateExtension on core::int {
+  method injectedMethod = test::_PrivateExtension|injectedMethod;
+  method tearoff injectedMethod = test::_PrivateExtension|get#injectedMethod;
+  static method staticInjectedMethod = test::_PrivateExtension|staticInjectedMethod;
+}
+extension _PrivateInjectedExtension on core::int { // from org-dartlang-testcase:///patch_lib.dart
+  method publicMethod = test::_PrivateInjectedExtension|publicMethod;
+  method tearoff publicMethod = test::_PrivateInjectedExtension|get#publicMethod;
 }
 static method /* from org-dartlang-testcase:///patch_lib.dart */ injectedMethod() → dynamic {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|injectedMethod(lowered final core::int #this) → dynamic {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|get#injectedMethod(lowered final core::int #this) → () → dynamic
+  return () → dynamic => test::Extension|injectedMethod(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|staticInjectedMethod() → dynamic {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ _PrivateInjectedExtension|publicMethod(lowered final core::int #this) → dynamic {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ _PrivateInjectedExtension|get#publicMethod(lowered final core::int #this) → () → dynamic
+  return () → dynamic => test::_PrivateInjectedExtension|publicMethod(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ _PrivateExtension|injectedMethod(lowered final core::int #this) → dynamic {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ _PrivateExtension|get#injectedMethod(lowered final core::int #this) → () → dynamic
+  return () → dynamic => test::_PrivateExtension|injectedMethod(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ _PrivateExtension|staticInjectedMethod() → dynamic {}
 
 constants  {
   #C1 = _in::_Patch {}
diff --git a/pkg/front_end/testcases/general/inject_public/origin_lib.dart b/pkg/front_end/testcases/general/inject_public/origin_lib.dart
index 8ffa6e4..6139ca2 100644
--- a/pkg/front_end/testcases/general/inject_public/origin_lib.dart
+++ b/pkg/front_end/testcases/general/inject_public/origin_lib.dart
@@ -3,3 +3,9 @@
 // BSD-style license that can be found in the LICENSE file.
 
 class Class {}
+
+extension Extension on int {}
+
+class _PrivateClass {}
+
+extension _PrivateExtension on int {}
diff --git a/pkg/front_end/testcases/general/inject_public/patch_lib.dart b/pkg/front_end/testcases/general/inject_public/patch_lib.dart
index 4f38587..de55ed7 100644
--- a/pkg/front_end/testcases/general/inject_public/patch_lib.dart
+++ b/pkg/front_end/testcases/general/inject_public/patch_lib.dart
@@ -5,11 +5,38 @@
 // ignore: import_internal_library
 import 'dart:_internal';
 
-class InjectedClass {}
+class InjectedClass {} // Error
 
-injectedMethod() {}
+injectedMethod() {} // Error
 
 @patch
 class Class {
-  injectedMethod() {}
+  injectedMethod() {} // Error
+  static staticInjectedMethod() {} // Error
+}
+
+@patch
+extension Extension on int {
+  injectedMethod() {} // Error
+  static staticInjectedMethod() {} // Error
+}
+
+class _PrivateInjectedClass /* Ok */ {
+  publicMethod() {} // Ok
+}
+
+extension _PrivateInjectedExtension on int /* Ok */ {
+  publicMethod() {} // Ok
+}
+
+@patch
+class _PrivateClass {
+  injectedMethod() {} // Error
+  static staticInjectedMethod() {} // Ok
+}
+
+@patch
+extension _PrivateExtension on int {
+  injectedMethod() {} // Error
+  static staticInjectedMethod() {} // Ok
 }
diff --git a/pkg/front_end/testcases/general/issue45101/main.dart.strong.expect b/pkg/front_end/testcases/general/issue45101/main.dart.strong.expect
index 375479e..55463c0 100644
--- a/pkg/front_end/testcases/general/issue45101/main.dart.strong.expect
+++ b/pkg/front_end/testcases/general/issue45101/main.dart.strong.expect
@@ -7,17 +7,11 @@
 
 library;
 import self as self2;
-import "dart:core" as core;
 import "dart:_internal" as _in;
+import "dart:core" as core;
 
 import "dart:_internal";
 
-class _ArraySize<T extends core::Object? = dynamic> extends core::Object implements self2::Array<self2::_ArraySize::T%> /*hasConstConstructor*/  { // from org-dartlang-testcase:///patch_lib.dart
-  final field core::int foo;
-  const constructor •(core::int foo) → self2::_ArraySize<self2::_ArraySize::T%>
-    : self2::_ArraySize::foo = foo, super core::Object::•()
-    ;
-}
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C1
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C4
 class Array<T extends core::Object? = dynamic> extends core::Object {
@@ -25,6 +19,12 @@
   static factory /* from org-dartlang-testcase:///patch_lib.dart */ •<T extends core::Object? = dynamic>(core::int foo) → self2::Array<self2::Array::•::T%> /* redirection-target: self2::_ArraySize::•<self2::Array::•::T%>*/
     return new self2::_ArraySize::•<self2::Array::•::T%>(foo);
 }
+class _ArraySize<T extends core::Object? = dynamic> extends core::Object implements self2::Array<self2::_ArraySize::T%> /*hasConstConstructor*/  { // from org-dartlang-testcase:///patch_lib.dart
+  final field core::int foo;
+  const constructor •(core::int foo) → self2::_ArraySize<self2::_ArraySize::T%>
+    : self2::_ArraySize::foo = foo, super core::Object::•()
+    ;
+}
 
 constants  {
   #C1 = _in::_Patch {}
diff --git a/pkg/front_end/testcases/general/issue45101/main.dart.strong.modular.expect b/pkg/front_end/testcases/general/issue45101/main.dart.strong.modular.expect
index 375479e..55463c0 100644
--- a/pkg/front_end/testcases/general/issue45101/main.dart.strong.modular.expect
+++ b/pkg/front_end/testcases/general/issue45101/main.dart.strong.modular.expect
@@ -7,17 +7,11 @@
 
 library;
 import self as self2;
-import "dart:core" as core;
 import "dart:_internal" as _in;
+import "dart:core" as core;
 
 import "dart:_internal";
 
-class _ArraySize<T extends core::Object? = dynamic> extends core::Object implements self2::Array<self2::_ArraySize::T%> /*hasConstConstructor*/  { // from org-dartlang-testcase:///patch_lib.dart
-  final field core::int foo;
-  const constructor •(core::int foo) → self2::_ArraySize<self2::_ArraySize::T%>
-    : self2::_ArraySize::foo = foo, super core::Object::•()
-    ;
-}
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C1
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C4
 class Array<T extends core::Object? = dynamic> extends core::Object {
@@ -25,6 +19,12 @@
   static factory /* from org-dartlang-testcase:///patch_lib.dart */ •<T extends core::Object? = dynamic>(core::int foo) → self2::Array<self2::Array::•::T%> /* redirection-target: self2::_ArraySize::•<self2::Array::•::T%>*/
     return new self2::_ArraySize::•<self2::Array::•::T%>(foo);
 }
+class _ArraySize<T extends core::Object? = dynamic> extends core::Object implements self2::Array<self2::_ArraySize::T%> /*hasConstConstructor*/  { // from org-dartlang-testcase:///patch_lib.dart
+  final field core::int foo;
+  const constructor •(core::int foo) → self2::_ArraySize<self2::_ArraySize::T%>
+    : self2::_ArraySize::foo = foo, super core::Object::•()
+    ;
+}
 
 constants  {
   #C1 = _in::_Patch {}
diff --git a/pkg/front_end/testcases/general/issue45101/main.dart.strong.outline.expect b/pkg/front_end/testcases/general/issue45101/main.dart.strong.outline.expect
index 8c0e628..fc7f661 100644
--- a/pkg/front_end/testcases/general/issue45101/main.dart.strong.outline.expect
+++ b/pkg/front_end/testcases/general/issue45101/main.dart.strong.outline.expect
@@ -8,17 +8,11 @@
 
 library;
 import self as self2;
-import "dart:core" as core;
 import "dart:_internal" as _in;
+import "dart:core" as core;
 
 import "dart:_internal";
 
-class _ArraySize<T extends core::Object? = dynamic> extends core::Object implements self2::Array<self2::_ArraySize::T%> /*hasConstConstructor*/  { // from org-dartlang-testcase:///patch_lib.dart
-  final field core::int foo;
-  const constructor •(core::int foo) → self2::_ArraySize<self2::_ArraySize::T%>
-    : self2::_ArraySize::foo = foo, super core::Object::•()
-    ;
-}
 @/* from org-dartlang-testcase:///patch_lib.dart */ _in::patch
 @/* from org-dartlang-testcase:///patch_lib.dart */ const core::pragma::_("vm:entry-point")
 class Array<T extends core::Object? = dynamic> extends core::Object {
@@ -26,6 +20,12 @@
   static factory /* from org-dartlang-testcase:///patch_lib.dart */ •<T extends core::Object? = dynamic>(core::int foo) → self2::Array<self2::Array::•::T%> /* redirection-target: self2::_ArraySize::•<self2::Array::•::T%>*/
     return new self2::_ArraySize::•<self2::Array::•::T%>(foo);
 }
+class _ArraySize<T extends core::Object? = dynamic> extends core::Object implements self2::Array<self2::_ArraySize::T%> /*hasConstConstructor*/  { // from org-dartlang-testcase:///patch_lib.dart
+  final field core::int foo;
+  const constructor •(core::int foo) → self2::_ArraySize<self2::_ArraySize::T%>
+    : self2::_ArraySize::foo = foo, super core::Object::•()
+    ;
+}
 
 
 Extra constant evaluation status:
diff --git a/pkg/front_end/testcases/general/issue45101/main.dart.strong.transformed.expect b/pkg/front_end/testcases/general/issue45101/main.dart.strong.transformed.expect
index 375479e..55463c0 100644
--- a/pkg/front_end/testcases/general/issue45101/main.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/issue45101/main.dart.strong.transformed.expect
@@ -7,17 +7,11 @@
 
 library;
 import self as self2;
-import "dart:core" as core;
 import "dart:_internal" as _in;
+import "dart:core" as core;
 
 import "dart:_internal";
 
-class _ArraySize<T extends core::Object? = dynamic> extends core::Object implements self2::Array<self2::_ArraySize::T%> /*hasConstConstructor*/  { // from org-dartlang-testcase:///patch_lib.dart
-  final field core::int foo;
-  const constructor •(core::int foo) → self2::_ArraySize<self2::_ArraySize::T%>
-    : self2::_ArraySize::foo = foo, super core::Object::•()
-    ;
-}
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C1
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C4
 class Array<T extends core::Object? = dynamic> extends core::Object {
@@ -25,6 +19,12 @@
   static factory /* from org-dartlang-testcase:///patch_lib.dart */ •<T extends core::Object? = dynamic>(core::int foo) → self2::Array<self2::Array::•::T%> /* redirection-target: self2::_ArraySize::•<self2::Array::•::T%>*/
     return new self2::_ArraySize::•<self2::Array::•::T%>(foo);
 }
+class _ArraySize<T extends core::Object? = dynamic> extends core::Object implements self2::Array<self2::_ArraySize::T%> /*hasConstConstructor*/  { // from org-dartlang-testcase:///patch_lib.dart
+  final field core::int foo;
+  const constructor •(core::int foo) → self2::_ArraySize<self2::_ArraySize::T%>
+    : self2::_ArraySize::foo = foo, super core::Object::•()
+    ;
+}
 
 constants  {
   #C1 = _in::_Patch {}
diff --git a/pkg/front_end/testcases/general/mixin_from_patch/main.dart.strong.expect b/pkg/front_end/testcases/general/mixin_from_patch/main.dart.strong.expect
index b9b1a31..3b2643b 100644
--- a/pkg/front_end/testcases/general/mixin_from_patch/main.dart.strong.expect
+++ b/pkg/front_end/testcases/general/mixin_from_patch/main.dart.strong.expect
@@ -20,9 +20,6 @@
 
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C1
 class Class extends core::Object {
-  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _internal({core::bool value = #C2}) → test::Class
-    : super core::Object::•()
-    ;
   @#C1
   constructor /* from org-dartlang-testcase:///patch_lib.dart */ patched() → test::Class
     : this test::Class::_internal()
@@ -30,14 +27,14 @@
   constructor unpatched() → test::Class
     : super core::Object::•()
     ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _internal({core::bool value = #C2}) → test::Class
+    : super core::Object::•()
+    ;
 }
 abstract class Mixin extends core::Object /*isMixinDeclaration*/  {
 }
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C1
 class SubClass extends test::_SubClass&Class&Mixin {
-  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _internal() → test::SubClass
-    : super test::_SubClass&Class&Mixin::_internal(value: true)
-    ;
   @#C1
   constructor /* from org-dartlang-testcase:///patch_lib.dart */ patched() → test::SubClass
     : this test::SubClass::_internal()
@@ -45,6 +42,9 @@
   constructor unpatched() → test::SubClass
     : super test::_SubClass&Class&Mixin::unpatched()
     ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _internal() → test::SubClass
+    : super test::_SubClass&Class&Mixin::_internal(value: true)
+    ;
 }
 abstract class _SubClass&Class&Mixin = test::Class with test::Mixin /*isAnonymousMixin*/  {
   synthetic constructor patched() → test::_SubClass&Class&Mixin
diff --git a/pkg/front_end/testcases/general/mixin_from_patch/main.dart.strong.modular.expect b/pkg/front_end/testcases/general/mixin_from_patch/main.dart.strong.modular.expect
index b9b1a31..3b2643b 100644
--- a/pkg/front_end/testcases/general/mixin_from_patch/main.dart.strong.modular.expect
+++ b/pkg/front_end/testcases/general/mixin_from_patch/main.dart.strong.modular.expect
@@ -20,9 +20,6 @@
 
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C1
 class Class extends core::Object {
-  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _internal({core::bool value = #C2}) → test::Class
-    : super core::Object::•()
-    ;
   @#C1
   constructor /* from org-dartlang-testcase:///patch_lib.dart */ patched() → test::Class
     : this test::Class::_internal()
@@ -30,14 +27,14 @@
   constructor unpatched() → test::Class
     : super core::Object::•()
     ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _internal({core::bool value = #C2}) → test::Class
+    : super core::Object::•()
+    ;
 }
 abstract class Mixin extends core::Object /*isMixinDeclaration*/  {
 }
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C1
 class SubClass extends test::_SubClass&Class&Mixin {
-  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _internal() → test::SubClass
-    : super test::_SubClass&Class&Mixin::_internal(value: true)
-    ;
   @#C1
   constructor /* from org-dartlang-testcase:///patch_lib.dart */ patched() → test::SubClass
     : this test::SubClass::_internal()
@@ -45,6 +42,9 @@
   constructor unpatched() → test::SubClass
     : super test::_SubClass&Class&Mixin::unpatched()
     ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _internal() → test::SubClass
+    : super test::_SubClass&Class&Mixin::_internal(value: true)
+    ;
 }
 abstract class _SubClass&Class&Mixin = test::Class with test::Mixin /*isAnonymousMixin*/  {
   synthetic constructor patched() → test::_SubClass&Class&Mixin
diff --git a/pkg/front_end/testcases/general/mixin_from_patch/main.dart.strong.outline.expect b/pkg/front_end/testcases/general/mixin_from_patch/main.dart.strong.outline.expect
index dddb724a..6d3f961 100644
--- a/pkg/front_end/testcases/general/mixin_from_patch/main.dart.strong.outline.expect
+++ b/pkg/front_end/testcases/general/mixin_from_patch/main.dart.strong.outline.expect
@@ -15,23 +15,23 @@
 
 @/* from org-dartlang-testcase:///patch_lib.dart */ _in::patch
 class Class extends core::Object {
-  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _internal({core::bool value = false}) → self2::Class
-    ;
   @_in::patch
   external constructor patched() → self2::Class;
   constructor unpatched() → self2::Class
     ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _internal({core::bool value = false}) → self2::Class
+    ;
 }
 abstract class Mixin extends core::Object /*isMixinDeclaration*/  {
 }
 @/* from org-dartlang-testcase:///patch_lib.dart */ _in::patch
 class SubClass extends self2::_SubClass&Class&Mixin {
-  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _internal() → self2::SubClass
-    ;
   @_in::patch
   external constructor patched() → self2::SubClass;
   constructor unpatched() → self2::SubClass
     ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _internal() → self2::SubClass
+    ;
 }
 abstract class _SubClass&Class&Mixin = self2::Class with self2::Mixin /*isAnonymousMixin*/  {
   synthetic constructor patched() → self2::_SubClass&Class&Mixin
diff --git a/pkg/front_end/testcases/general/mixin_from_patch/main.dart.strong.transformed.expect b/pkg/front_end/testcases/general/mixin_from_patch/main.dart.strong.transformed.expect
index 8134a1f..44649ad 100644
--- a/pkg/front_end/testcases/general/mixin_from_patch/main.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/mixin_from_patch/main.dart.strong.transformed.expect
@@ -20,9 +20,6 @@
 
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C1
 class Class extends core::Object {
-  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _internal({core::bool value = #C2}) → test::Class
-    : super core::Object::•()
-    ;
   @#C1
   constructor /* from org-dartlang-testcase:///patch_lib.dart */ patched() → test::Class
     : this test::Class::_internal()
@@ -30,14 +27,14 @@
   constructor unpatched() → test::Class
     : super core::Object::•()
     ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _internal({core::bool value = #C2}) → test::Class
+    : super core::Object::•()
+    ;
 }
 abstract class Mixin extends core::Object /*isMixinDeclaration*/  {
 }
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C1
 class SubClass extends test::_SubClass&Class&Mixin {
-  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _internal() → test::SubClass
-    : super test::_SubClass&Class&Mixin::_internal(value: true)
-    ;
   @#C1
   constructor /* from org-dartlang-testcase:///patch_lib.dart */ patched() → test::SubClass
     : this test::SubClass::_internal()
@@ -45,6 +42,9 @@
   constructor unpatched() → test::SubClass
     : super test::_SubClass&Class&Mixin::unpatched()
     ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _internal() → test::SubClass
+    : super test::_SubClass&Class&Mixin::_internal(value: true)
+    ;
 }
 abstract class _SubClass&Class&Mixin extends test::Class implements test::Mixin /*isAnonymousMixin,isEliminatedMixin*/  {
   synthetic constructor patched() → test::_SubClass&Class&Mixin
diff --git a/pkg/front_end/testcases/general/patch_annotations/main.dart.strong.expect b/pkg/front_end/testcases/general/patch_annotations/main.dart.strong.expect
index 87f5934..c4c9ff3 100644
--- a/pkg/front_end/testcases/general/patch_annotations/main.dart.strong.expect
+++ b/pkg/front_end/testcases/general/patch_annotations/main.dart.strong.expect
@@ -5,8 +5,7 @@
 
 static method main() → dynamic {}
 
-@/* from org-dartlang-testcase:///patch_lib.dart */ #C3
-@#C5
+@#C3
 library;
 import self as self2;
 import "dart:core" as core;
@@ -14,45 +13,43 @@
 
 import "dart:_internal";
 
+@#C5
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C6
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C8
-@#C10
-class Class<@#C12 @#C14 T extends core::Object? = dynamic> extends core::Object {
+class Class<@#C10 @#C12 T extends core::Object? = dynamic> extends core::Object {
+  @/* from org-dartlang-testcase:///origin_lib.dart */ #C14
   @#C6
   @#C16
-  @/* from org-dartlang-testcase:///origin_lib.dart */ #C18
   external constructor /* from org-dartlang-testcase:///patch_lib.dart */ •() → self2::Class<self2::Class::T%>;
+  @/* from org-dartlang-testcase:///origin_lib.dart */ #C18
   @#C6
   @#C20
-  @/* from org-dartlang-testcase:///origin_lib.dart */ #C22
-  external method /* from org-dartlang-testcase:///patch_lib.dart */ method<@#C24 S extends core::Object? = dynamic>() → void;
+  external method /* from org-dartlang-testcase:///patch_lib.dart */ method<@#C22 S extends core::Object? = dynamic>() → void;
 }
 
 constants  {
-  #C1 = "patch-library"
+  #C1 = "origin-library"
   #C2 = null
   #C3 = core::pragma {name:#C1, options:#C2}
-  #C4 = "origin-library"
+  #C4 = "origin-class"
   #C5 = core::pragma {name:#C4, options:#C2}
   #C6 = _in::_Patch {}
   #C7 = "patch-class"
   #C8 = core::pragma {name:#C7, options:#C2}
-  #C9 = "origin-class"
+  #C9 = "origin-class-type-variable"
   #C10 = core::pragma {name:#C9, options:#C2}
   #C11 = "patch-class-type-variable"
   #C12 = core::pragma {name:#C11, options:#C2}
-  #C13 = "origin-class-type-variable"
+  #C13 = "origin-constructor"
   #C14 = core::pragma {name:#C13, options:#C2}
   #C15 = "patch-constructor"
   #C16 = core::pragma {name:#C15, options:#C2}
-  #C17 = "origin-constructor"
+  #C17 = "origin-procedure"
   #C18 = core::pragma {name:#C17, options:#C2}
   #C19 = "patch-procedure"
   #C20 = core::pragma {name:#C19, options:#C2}
-  #C21 = "origin-procedure"
+  #C21 = "patch-method-type-variable"
   #C22 = core::pragma {name:#C21, options:#C2}
-  #C23 = "patch-method-type-variable"
-  #C24 = core::pragma {name:#C23, options:#C2}
 }
 
 
diff --git a/pkg/front_end/testcases/general/patch_annotations/main.dart.strong.modular.expect b/pkg/front_end/testcases/general/patch_annotations/main.dart.strong.modular.expect
index 87f5934..c4c9ff3 100644
--- a/pkg/front_end/testcases/general/patch_annotations/main.dart.strong.modular.expect
+++ b/pkg/front_end/testcases/general/patch_annotations/main.dart.strong.modular.expect
@@ -5,8 +5,7 @@
 
 static method main() → dynamic {}
 
-@/* from org-dartlang-testcase:///patch_lib.dart */ #C3
-@#C5
+@#C3
 library;
 import self as self2;
 import "dart:core" as core;
@@ -14,45 +13,43 @@
 
 import "dart:_internal";
 
+@#C5
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C6
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C8
-@#C10
-class Class<@#C12 @#C14 T extends core::Object? = dynamic> extends core::Object {
+class Class<@#C10 @#C12 T extends core::Object? = dynamic> extends core::Object {
+  @/* from org-dartlang-testcase:///origin_lib.dart */ #C14
   @#C6
   @#C16
-  @/* from org-dartlang-testcase:///origin_lib.dart */ #C18
   external constructor /* from org-dartlang-testcase:///patch_lib.dart */ •() → self2::Class<self2::Class::T%>;
+  @/* from org-dartlang-testcase:///origin_lib.dart */ #C18
   @#C6
   @#C20
-  @/* from org-dartlang-testcase:///origin_lib.dart */ #C22
-  external method /* from org-dartlang-testcase:///patch_lib.dart */ method<@#C24 S extends core::Object? = dynamic>() → void;
+  external method /* from org-dartlang-testcase:///patch_lib.dart */ method<@#C22 S extends core::Object? = dynamic>() → void;
 }
 
 constants  {
-  #C1 = "patch-library"
+  #C1 = "origin-library"
   #C2 = null
   #C3 = core::pragma {name:#C1, options:#C2}
-  #C4 = "origin-library"
+  #C4 = "origin-class"
   #C5 = core::pragma {name:#C4, options:#C2}
   #C6 = _in::_Patch {}
   #C7 = "patch-class"
   #C8 = core::pragma {name:#C7, options:#C2}
-  #C9 = "origin-class"
+  #C9 = "origin-class-type-variable"
   #C10 = core::pragma {name:#C9, options:#C2}
   #C11 = "patch-class-type-variable"
   #C12 = core::pragma {name:#C11, options:#C2}
-  #C13 = "origin-class-type-variable"
+  #C13 = "origin-constructor"
   #C14 = core::pragma {name:#C13, options:#C2}
   #C15 = "patch-constructor"
   #C16 = core::pragma {name:#C15, options:#C2}
-  #C17 = "origin-constructor"
+  #C17 = "origin-procedure"
   #C18 = core::pragma {name:#C17, options:#C2}
   #C19 = "patch-procedure"
   #C20 = core::pragma {name:#C19, options:#C2}
-  #C21 = "origin-procedure"
+  #C21 = "patch-method-type-variable"
   #C22 = core::pragma {name:#C21, options:#C2}
-  #C23 = "patch-method-type-variable"
-  #C24 = core::pragma {name:#C23, options:#C2}
 }
 
 
diff --git a/pkg/front_end/testcases/general/patch_annotations/main.dart.strong.outline.expect b/pkg/front_end/testcases/general/patch_annotations/main.dart.strong.outline.expect
index f38c3d3..9dcff0a 100644
--- a/pkg/front_end/testcases/general/patch_annotations/main.dart.strong.outline.expect
+++ b/pkg/front_end/testcases/general/patch_annotations/main.dart.strong.outline.expect
@@ -6,7 +6,6 @@
 static method main() → dynamic
   ;
 
-@/* from org-dartlang-testcase:///patch_lib.dart */ const dart.core::pragma::_("patch-library")
 @dart.core::pragma::_("origin-library")
 library;
 import self as self2;
@@ -15,34 +14,33 @@
 
 import "dart:_internal";
 
+@core::pragma::_("origin-class")
 @/* from org-dartlang-testcase:///patch_lib.dart */ _in::patch
 @/* from org-dartlang-testcase:///patch_lib.dart */ const core::pragma::_("patch-class")
-@core::pragma::_("origin-class")
-class Class<@core::pragma::_("patch-class-type-variable") @core::pragma::_("origin-class-type-variable") T extends core::Object? = dynamic> extends core::Object {
+class Class<@core::pragma::_("origin-class-type-variable") @core::pragma::_("patch-class-type-variable") T extends core::Object? = dynamic> extends core::Object {
+  @/* from org-dartlang-testcase:///origin_lib.dart */ const core::pragma::_("origin-constructor")
   @_in::patch
   @core::pragma::_("patch-constructor")
-  @/* from org-dartlang-testcase:///origin_lib.dart */ const core::pragma::_("origin-constructor")
   external constructor •() → self2::Class<self2::Class::T%>;
+  @/* from org-dartlang-testcase:///origin_lib.dart */ const core::pragma::_("origin-procedure")
   @_in::patch
   @core::pragma::_("patch-procedure")
-  @/* from org-dartlang-testcase:///origin_lib.dart */ const core::pragma::_("origin-procedure")
   external method method<@core::pragma::_("origin-method-type-variable") S extends core::Object? = dynamic>() → void;
 }
 
 
 Extra constant evaluation status:
-Evaluated: FileUriExpression @ org-dartlang-testcase:///patch_lib.dart:5:1 -> InstanceConstant(const pragma{pragma.name: "patch-library", pragma.options: null})
 Evaluated: ConstructorInvocation @ org-dartlang-testcase:///origin_lib.dart:5:2 -> InstanceConstant(const pragma{pragma.name: "origin-library", pragma.options: null})
-Evaluated: FileUriExpression @ org-dartlang-testcase:///patch_lib.dart:11:1 -> InstanceConstant(const _Patch{})
-Evaluated: FileUriExpression @ org-dartlang-testcase:///patch_lib.dart:12:1 -> InstanceConstant(const pragma{pragma.name: "patch-class", pragma.options: null})
 Evaluated: ConstructorInvocation @ org-dartlang-testcase:///origin_lib.dart:8:2 -> InstanceConstant(const pragma{pragma.name: "origin-class", pragma.options: null})
-Evaluated: ConstructorInvocation @ org-dartlang-testcase:///origin_lib.dart:10:25 -> InstanceConstant(const pragma{pragma.name: "patch-class-type-variable", pragma.options: null})
+Evaluated: FileUriExpression @ org-dartlang-testcase:///patch_lib.dart:8:1 -> InstanceConstant(const _Patch{})
+Evaluated: FileUriExpression @ org-dartlang-testcase:///patch_lib.dart:9:1 -> InstanceConstant(const pragma{pragma.name: "patch-class", pragma.options: null})
 Evaluated: ConstructorInvocation @ org-dartlang-testcase:///origin_lib.dart:9:14 -> InstanceConstant(const pragma{pragma.name: "origin-class-type-variable", pragma.options: null})
-Evaluated: StaticGet @ org-dartlang-testcase:///origin_lib.dart:13:16 -> InstanceConstant(const _Patch{})
-Evaluated: ConstructorInvocation @ org-dartlang-testcase:///origin_lib.dart:13:25 -> InstanceConstant(const pragma{pragma.name: "patch-constructor", pragma.options: null})
+Evaluated: ConstructorInvocation @ org-dartlang-testcase:///origin_lib.dart:9:45 -> InstanceConstant(const pragma{pragma.name: "patch-class-type-variable", pragma.options: null})
 Evaluated: FileUriExpression @ org-dartlang-testcase:///origin_lib.dart:10:3 -> InstanceConstant(const pragma{pragma.name: "origin-constructor", pragma.options: null})
-Evaluated: StaticGet @ org-dartlang-testcase:///origin_lib.dart:14:47 -> InstanceConstant(const _Patch{})
-Evaluated: ConstructorInvocation @ org-dartlang-testcase:///origin_lib.dart:14:56 -> InstanceConstant(const pragma{pragma.name: "patch-procedure", pragma.options: null})
+Evaluated: StaticGet @ org-dartlang-testcase:///origin_lib.dart:11:2 -> InstanceConstant(const _Patch{})
+Evaluated: ConstructorInvocation @ org-dartlang-testcase:///origin_lib.dart:11:11 -> InstanceConstant(const pragma{pragma.name: "patch-constructor", pragma.options: null})
 Evaluated: FileUriExpression @ org-dartlang-testcase:///origin_lib.dart:13:3 -> InstanceConstant(const pragma{pragma.name: "origin-procedure", pragma.options: null})
+Evaluated: StaticGet @ org-dartlang-testcase:///origin_lib.dart:14:12 -> InstanceConstant(const _Patch{})
+Evaluated: ConstructorInvocation @ org-dartlang-testcase:///origin_lib.dart:14:21 -> InstanceConstant(const pragma{pragma.name: "patch-procedure", pragma.options: null})
 Evaluated: ConstructorInvocation @ org-dartlang-testcase:///origin_lib.dart:14:25 -> InstanceConstant(const pragma{pragma.name: "origin-method-type-variable", pragma.options: null})
-Extra constant evaluation: evaluated: 14, effectively constant: 14
+Extra constant evaluation: evaluated: 13, effectively constant: 13
diff --git a/pkg/front_end/testcases/general/patch_annotations/main.dart.strong.transformed.expect b/pkg/front_end/testcases/general/patch_annotations/main.dart.strong.transformed.expect
index 87f5934..c4c9ff3 100644
--- a/pkg/front_end/testcases/general/patch_annotations/main.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/patch_annotations/main.dart.strong.transformed.expect
@@ -5,8 +5,7 @@
 
 static method main() → dynamic {}
 
-@/* from org-dartlang-testcase:///patch_lib.dart */ #C3
-@#C5
+@#C3
 library;
 import self as self2;
 import "dart:core" as core;
@@ -14,45 +13,43 @@
 
 import "dart:_internal";
 
+@#C5
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C6
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C8
-@#C10
-class Class<@#C12 @#C14 T extends core::Object? = dynamic> extends core::Object {
+class Class<@#C10 @#C12 T extends core::Object? = dynamic> extends core::Object {
+  @/* from org-dartlang-testcase:///origin_lib.dart */ #C14
   @#C6
   @#C16
-  @/* from org-dartlang-testcase:///origin_lib.dart */ #C18
   external constructor /* from org-dartlang-testcase:///patch_lib.dart */ •() → self2::Class<self2::Class::T%>;
+  @/* from org-dartlang-testcase:///origin_lib.dart */ #C18
   @#C6
   @#C20
-  @/* from org-dartlang-testcase:///origin_lib.dart */ #C22
-  external method /* from org-dartlang-testcase:///patch_lib.dart */ method<@#C24 S extends core::Object? = dynamic>() → void;
+  external method /* from org-dartlang-testcase:///patch_lib.dart */ method<@#C22 S extends core::Object? = dynamic>() → void;
 }
 
 constants  {
-  #C1 = "patch-library"
+  #C1 = "origin-library"
   #C2 = null
   #C3 = core::pragma {name:#C1, options:#C2}
-  #C4 = "origin-library"
+  #C4 = "origin-class"
   #C5 = core::pragma {name:#C4, options:#C2}
   #C6 = _in::_Patch {}
   #C7 = "patch-class"
   #C8 = core::pragma {name:#C7, options:#C2}
-  #C9 = "origin-class"
+  #C9 = "origin-class-type-variable"
   #C10 = core::pragma {name:#C9, options:#C2}
   #C11 = "patch-class-type-variable"
   #C12 = core::pragma {name:#C11, options:#C2}
-  #C13 = "origin-class-type-variable"
+  #C13 = "origin-constructor"
   #C14 = core::pragma {name:#C13, options:#C2}
   #C15 = "patch-constructor"
   #C16 = core::pragma {name:#C15, options:#C2}
-  #C17 = "origin-constructor"
+  #C17 = "origin-procedure"
   #C18 = core::pragma {name:#C17, options:#C2}
   #C19 = "patch-procedure"
   #C20 = core::pragma {name:#C19, options:#C2}
-  #C21 = "origin-procedure"
+  #C21 = "patch-method-type-variable"
   #C22 = core::pragma {name:#C21, options:#C2}
-  #C23 = "patch-method-type-variable"
-  #C24 = core::pragma {name:#C23, options:#C2}
 }
 
 
diff --git a/pkg/front_end/testcases/general/patch_annotations/patch_lib.dart b/pkg/front_end/testcases/general/patch_annotations/patch_lib.dart
index 717ed23..eb0ef61 100644
--- a/pkg/front_end/testcases/general/patch_annotations/patch_lib.dart
+++ b/pkg/front_end/testcases/general/patch_annotations/patch_lib.dart
@@ -2,9 +2,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-@pragma('patch-library')
-library;
-
 // ignore: import_internal_library
 import 'dart:_internal';
 
diff --git a/pkg/front_end/testcases/general/patch_conflict/main.dart.strong.expect b/pkg/front_end/testcases/general/patch_conflict/main.dart.strong.expect
index ca13ee5..cc2093c 100644
--- a/pkg/front_end/testcases/general/patch_conflict/main.dart.strong.expect
+++ b/pkg/front_end/testcases/general/patch_conflict/main.dart.strong.expect
@@ -9,70 +9,95 @@
 //
 // Problems in library:
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:16:8: Error: Patch member 'missingOriginMethod' doesn't match a member in the origin class.
-// Try changing the name to an existing member or removing the '@patch' annotation.
-//   void missingOriginMethod() {} /* Error: missing origin method */
-//        ^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:30:6: Error: 'existingOriginMethod' is already declared in this scope.
+// void existingOriginMethod() {} /* Error: conflict with origin method */
+//      ^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:13:6: Context: Previous declaration of 'existingOriginMethod'.
+// void existingOriginMethod() {}
+//      ^^^^^^^^^^^^^^^^^^^^
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:18:8: Error: Member 'existingOriginMethod' conflicts with an existing member of the same name in the origin class.
-// Try changing the name of the member or adding an '@patch' annotation.
-//   void existingOriginMethod() {} /* Error: conflict with origin method */
-//        ^^^^^^^^^^^^^^^^^^^^
-// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:10:8: Context: This is the existing member.
-//   void existingOriginMethod() {}
-//        ^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:30:6: Error: Can't inject public 'existingOriginMethod' into 'dart:test'.
+// Make 'existingOriginMethod' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+// void existingOriginMethod() {} /* Error: conflict with origin method */
+//      ^
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:11:3: Error: Patch constructor 'Class.missingOriginConstructor' doesn't match a constructor in the origin class.
-// Try changing the name to an existing constructor or removing the '@patch' annotation.
-//   Class.missingOriginConstructor(); /* Error: missing origin class */
-//   ^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:32:7: Error: 'existingOriginDeclaration' is already declared in this scope.
+// class existingOriginDeclaration {} /* Error: conflict with origin declaration */
+//       ^^^^^^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:15:6: Context: Previous declaration of 'existingOriginDeclaration'.
+// void existingOriginDeclaration() {}
+//      ^^^^^^^^^^^^^^^^^^^^^^^^^
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:13:3: Error: Constructor 'Class.existingOriginConstructor' conflicts with an existing constructor of the same name in the origin class.
-// Try changing the name of the constructor or adding an '@patch' annotation.
-//   Class.existingOriginConstructor(); /* Error: conflict with origin class */
-//   ^
-// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:8:3: Context: This is the existing constructor.
-//   Class.existingOriginConstructor();
-//   ^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:32:7: Error: Can't inject public 'existingOriginDeclaration' into 'dart:test'.
+// Make 'existingOriginDeclaration' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+// class existingOriginDeclaration {} /* Error: conflict with origin declaration */
+//       ^
+//
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:34:7: Error: 'ExistingOriginClass' is already declared in this scope.
+// class ExistingOriginClass {} /* Error: conflict with origin class */
+//       ^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:17:7: Context: Previous declaration of 'ExistingOriginClass'.
+// class ExistingOriginClass {}
+//       ^^^^^^^^^^^^^^^^^^^
+//
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:34:7: Error: Can't inject public 'ExistingOriginClass' into 'dart:test'.
+// Make 'ExistingOriginClass' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+// class ExistingOriginClass {} /* Error: conflict with origin class */
+//       ^
 //
 // pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:22:6: Error: Patch member 'missingOriginMethod' doesn't match a member in the origin library.
 // Try changing the name to an existing member or removing the '@patch' annotation.
 // void missingOriginMethod() {} /* Error: missing origin method */
-//      ^^^^^^^^^^^^^^^^^^^
+//      ^
+//
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:22:6: Error: Can't inject public 'missingOriginMethod' into 'dart:test'.
+// Make 'missingOriginMethod' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+// void missingOriginMethod() {} /* Error: missing origin method */
+//      ^
 //
 // pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:25:7: Error: Patch class 'MissingOriginClass' doesn't match a class in the origin library.
 // Try changing the name to an existing class or removing the '@patch' annotation.
 // class MissingOriginClass {} /* Error: missing origin class */
-//       ^^^^^^^^^^^^^^^^^^
+//       ^
+//
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:25:7: Error: Can't inject public 'MissingOriginClass' into 'dart:test'.
+// Make 'MissingOriginClass' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+// class MissingOriginClass {} /* Error: missing origin class */
+//       ^
 //
 // pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:28:11: Error: Patch 'MissingOriginExtension' doesn't match a declaration in the origin library.
 // Try changing the name to an existing declaration or removing the '@patch' annotation.
 // extension MissingOriginExtension on int {} /* Error: missing origin extension */
-//           ^^^^^^^^^^^^^^^^^^^^^^
+//           ^
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:30:6: Error: Member 'existingOriginMethod' conflicts with an existing member of the same name in the origin library.
-// Try changing the name of the member or adding an '@patch' annotation.
-// void existingOriginMethod() {} /* Error: conflict with origin method */
-//      ^^^^^^^^^^^^^^^^^^^^
-// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:13:6: Context: This is the existing member.
-// void existingOriginMethod() {}
-//      ^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:28:11: Error: Can't inject public 'MissingOriginExtension' into 'dart:test'.
+// Make 'MissingOriginExtension' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+// extension MissingOriginExtension on int {} /* Error: missing origin extension */
+//           ^
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:32:7: Error: Declaration 'existingOriginDeclaration' conflicts with an existing declaration of the same name in the origin library.
-// Try changing the name of the declaration.
-// class existingOriginDeclaration {} /* Error: conflict with origin declaration */
-//       ^^^^^^^^^^^^^^^^^^^^^^^^^
-// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:15:6: Context: This is the existing member.
-// void existingOriginDeclaration() {}
-//      ^^^^^^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:13:3: Error: 'Class.existingOriginConstructor' is already declared in this scope.
+//   Class.existingOriginConstructor(); /* Error: conflict with origin class */
+//   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:8:3: Context: Previous declaration of 'Class.existingOriginConstructor'.
+//   Class.existingOriginConstructor();
+//   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:34:7: Error: Class 'ExistingOriginClass' conflicts with an existing class of the same name in the origin library.
-// Try changing the name of the class or adding an '@patch' annotation.
-// class ExistingOriginClass {} /* Error: conflict with origin class */
-//       ^^^^^^^^^^^^^^^^^^^
-// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:17:7: Context: This is the existing class.
-// class ExistingOriginClass {}
-//       ^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:18:8: Error: 'existingOriginMethod' is already declared in this scope.
+//   void existingOriginMethod() {} /* Error: conflict with origin method */
+//        ^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:10:8: Context: Previous declaration of 'existingOriginMethod'.
+//   void existingOriginMethod() {}
+//        ^^^^^^^^^^^^^^^^^^^^
+//
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:11:3: Error: Patch member 'missingOriginConstructor' doesn't match a member in the origin class.
+// Try changing the name to an existing member or removing the '@patch' annotation.
+//   Class.missingOriginConstructor(); /* Error: missing origin class */
+//   ^
+//
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:16:8: Error: Patch member 'missingOriginMethod' doesn't match a member in the origin class.
+// Try changing the name to an existing member or removing the '@patch' annotation.
+//   void missingOriginMethod() {} /* Error: missing origin method */
+//        ^
 //
 import self as self2;
 import "dart:_internal" as _in;
@@ -80,51 +105,50 @@
 
 import "dart:_internal";
 
-@#C1
-class MissingOriginClass extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
-  synthetic constructor •() → self2::MissingOriginClass
-    : super core::Object::•()
-    ;
-}
-class existingOriginDeclaration#0#1 extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
-  synthetic constructor •() → self2::existingOriginDeclaration#0#1
-    : super core::Object::•()
-    ;
-}
-class ExistingOriginClass#0#1 extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
-  synthetic constructor •() → self2::ExistingOriginClass#0#1
-    : super core::Object::•()
-    ;
-}
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C1
 class Class extends core::Object {
-  @#C1
-  constructor /* from org-dartlang-testcase:///patch_lib.dart */ missingOriginConstructor() → self2::Class
-    : super core::Object::•()
-    ;
   constructor •() → self2::Class
     : super core::Object::•()
     ;
   constructor existingOriginConstructor() → self2::Class
     : super core::Object::•()
     ;
+  @#C1
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ missingOriginConstructor() → self2::Class
+    : super core::Object::•()
+    ;
   method existingOriginMethod() → void {}
   @#C1
   method /* from org-dartlang-testcase:///patch_lib.dart */ missingOriginMethod() → void {}
 }
+class existingOriginDeclaration#1#0 extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  synthetic constructor •() → self2::existingOriginDeclaration#1#0
+    : super core::Object::•()
+    ;
+}
+class ExistingOriginClass#1#0 extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  synthetic constructor •() → self2::ExistingOriginClass#1#0
+    : super core::Object::•()
+    ;
+}
 class ExistingOriginClass extends core::Object {
   synthetic constructor •() → self2::ExistingOriginClass
     : super core::Object::•()
     ;
 }
 @#C1
+class _#MissingOriginClass#augmentationWithoutOrigin0 extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  synthetic constructor •() → self2::_#MissingOriginClass#augmentationWithoutOrigin0
+    : super core::Object::•()
+    ;
+}
+@#C1
 extension MissingOriginExtension on core::int { // from org-dartlang-testcase:///patch_lib.dart
 }
 static method existingOriginMethod() → void {}
 static method existingOriginDeclaration() → void {}
 @#C1
 static method /* from org-dartlang-testcase:///patch_lib.dart */ missingOriginMethod() → void {}
-static method /* from org-dartlang-testcase:///patch_lib.dart */ existingOriginMethod#1() → void {}
 
 constants  {
   #C1 = _in::_Patch {}
diff --git a/pkg/front_end/testcases/general/patch_conflict/main.dart.strong.modular.expect b/pkg/front_end/testcases/general/patch_conflict/main.dart.strong.modular.expect
index ca13ee5..cc2093c 100644
--- a/pkg/front_end/testcases/general/patch_conflict/main.dart.strong.modular.expect
+++ b/pkg/front_end/testcases/general/patch_conflict/main.dart.strong.modular.expect
@@ -9,70 +9,95 @@
 //
 // Problems in library:
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:16:8: Error: Patch member 'missingOriginMethod' doesn't match a member in the origin class.
-// Try changing the name to an existing member or removing the '@patch' annotation.
-//   void missingOriginMethod() {} /* Error: missing origin method */
-//        ^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:30:6: Error: 'existingOriginMethod' is already declared in this scope.
+// void existingOriginMethod() {} /* Error: conflict with origin method */
+//      ^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:13:6: Context: Previous declaration of 'existingOriginMethod'.
+// void existingOriginMethod() {}
+//      ^^^^^^^^^^^^^^^^^^^^
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:18:8: Error: Member 'existingOriginMethod' conflicts with an existing member of the same name in the origin class.
-// Try changing the name of the member or adding an '@patch' annotation.
-//   void existingOriginMethod() {} /* Error: conflict with origin method */
-//        ^^^^^^^^^^^^^^^^^^^^
-// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:10:8: Context: This is the existing member.
-//   void existingOriginMethod() {}
-//        ^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:30:6: Error: Can't inject public 'existingOriginMethod' into 'dart:test'.
+// Make 'existingOriginMethod' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+// void existingOriginMethod() {} /* Error: conflict with origin method */
+//      ^
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:11:3: Error: Patch constructor 'Class.missingOriginConstructor' doesn't match a constructor in the origin class.
-// Try changing the name to an existing constructor or removing the '@patch' annotation.
-//   Class.missingOriginConstructor(); /* Error: missing origin class */
-//   ^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:32:7: Error: 'existingOriginDeclaration' is already declared in this scope.
+// class existingOriginDeclaration {} /* Error: conflict with origin declaration */
+//       ^^^^^^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:15:6: Context: Previous declaration of 'existingOriginDeclaration'.
+// void existingOriginDeclaration() {}
+//      ^^^^^^^^^^^^^^^^^^^^^^^^^
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:13:3: Error: Constructor 'Class.existingOriginConstructor' conflicts with an existing constructor of the same name in the origin class.
-// Try changing the name of the constructor or adding an '@patch' annotation.
-//   Class.existingOriginConstructor(); /* Error: conflict with origin class */
-//   ^
-// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:8:3: Context: This is the existing constructor.
-//   Class.existingOriginConstructor();
-//   ^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:32:7: Error: Can't inject public 'existingOriginDeclaration' into 'dart:test'.
+// Make 'existingOriginDeclaration' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+// class existingOriginDeclaration {} /* Error: conflict with origin declaration */
+//       ^
+//
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:34:7: Error: 'ExistingOriginClass' is already declared in this scope.
+// class ExistingOriginClass {} /* Error: conflict with origin class */
+//       ^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:17:7: Context: Previous declaration of 'ExistingOriginClass'.
+// class ExistingOriginClass {}
+//       ^^^^^^^^^^^^^^^^^^^
+//
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:34:7: Error: Can't inject public 'ExistingOriginClass' into 'dart:test'.
+// Make 'ExistingOriginClass' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+// class ExistingOriginClass {} /* Error: conflict with origin class */
+//       ^
 //
 // pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:22:6: Error: Patch member 'missingOriginMethod' doesn't match a member in the origin library.
 // Try changing the name to an existing member or removing the '@patch' annotation.
 // void missingOriginMethod() {} /* Error: missing origin method */
-//      ^^^^^^^^^^^^^^^^^^^
+//      ^
+//
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:22:6: Error: Can't inject public 'missingOriginMethod' into 'dart:test'.
+// Make 'missingOriginMethod' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+// void missingOriginMethod() {} /* Error: missing origin method */
+//      ^
 //
 // pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:25:7: Error: Patch class 'MissingOriginClass' doesn't match a class in the origin library.
 // Try changing the name to an existing class or removing the '@patch' annotation.
 // class MissingOriginClass {} /* Error: missing origin class */
-//       ^^^^^^^^^^^^^^^^^^
+//       ^
+//
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:25:7: Error: Can't inject public 'MissingOriginClass' into 'dart:test'.
+// Make 'MissingOriginClass' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+// class MissingOriginClass {} /* Error: missing origin class */
+//       ^
 //
 // pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:28:11: Error: Patch 'MissingOriginExtension' doesn't match a declaration in the origin library.
 // Try changing the name to an existing declaration or removing the '@patch' annotation.
 // extension MissingOriginExtension on int {} /* Error: missing origin extension */
-//           ^^^^^^^^^^^^^^^^^^^^^^
+//           ^
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:30:6: Error: Member 'existingOriginMethod' conflicts with an existing member of the same name in the origin library.
-// Try changing the name of the member or adding an '@patch' annotation.
-// void existingOriginMethod() {} /* Error: conflict with origin method */
-//      ^^^^^^^^^^^^^^^^^^^^
-// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:13:6: Context: This is the existing member.
-// void existingOriginMethod() {}
-//      ^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:28:11: Error: Can't inject public 'MissingOriginExtension' into 'dart:test'.
+// Make 'MissingOriginExtension' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+// extension MissingOriginExtension on int {} /* Error: missing origin extension */
+//           ^
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:32:7: Error: Declaration 'existingOriginDeclaration' conflicts with an existing declaration of the same name in the origin library.
-// Try changing the name of the declaration.
-// class existingOriginDeclaration {} /* Error: conflict with origin declaration */
-//       ^^^^^^^^^^^^^^^^^^^^^^^^^
-// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:15:6: Context: This is the existing member.
-// void existingOriginDeclaration() {}
-//      ^^^^^^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:13:3: Error: 'Class.existingOriginConstructor' is already declared in this scope.
+//   Class.existingOriginConstructor(); /* Error: conflict with origin class */
+//   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:8:3: Context: Previous declaration of 'Class.existingOriginConstructor'.
+//   Class.existingOriginConstructor();
+//   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:34:7: Error: Class 'ExistingOriginClass' conflicts with an existing class of the same name in the origin library.
-// Try changing the name of the class or adding an '@patch' annotation.
-// class ExistingOriginClass {} /* Error: conflict with origin class */
-//       ^^^^^^^^^^^^^^^^^^^
-// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:17:7: Context: This is the existing class.
-// class ExistingOriginClass {}
-//       ^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:18:8: Error: 'existingOriginMethod' is already declared in this scope.
+//   void existingOriginMethod() {} /* Error: conflict with origin method */
+//        ^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:10:8: Context: Previous declaration of 'existingOriginMethod'.
+//   void existingOriginMethod() {}
+//        ^^^^^^^^^^^^^^^^^^^^
+//
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:11:3: Error: Patch member 'missingOriginConstructor' doesn't match a member in the origin class.
+// Try changing the name to an existing member or removing the '@patch' annotation.
+//   Class.missingOriginConstructor(); /* Error: missing origin class */
+//   ^
+//
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:16:8: Error: Patch member 'missingOriginMethod' doesn't match a member in the origin class.
+// Try changing the name to an existing member or removing the '@patch' annotation.
+//   void missingOriginMethod() {} /* Error: missing origin method */
+//        ^
 //
 import self as self2;
 import "dart:_internal" as _in;
@@ -80,51 +105,50 @@
 
 import "dart:_internal";
 
-@#C1
-class MissingOriginClass extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
-  synthetic constructor •() → self2::MissingOriginClass
-    : super core::Object::•()
-    ;
-}
-class existingOriginDeclaration#0#1 extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
-  synthetic constructor •() → self2::existingOriginDeclaration#0#1
-    : super core::Object::•()
-    ;
-}
-class ExistingOriginClass#0#1 extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
-  synthetic constructor •() → self2::ExistingOriginClass#0#1
-    : super core::Object::•()
-    ;
-}
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C1
 class Class extends core::Object {
-  @#C1
-  constructor /* from org-dartlang-testcase:///patch_lib.dart */ missingOriginConstructor() → self2::Class
-    : super core::Object::•()
-    ;
   constructor •() → self2::Class
     : super core::Object::•()
     ;
   constructor existingOriginConstructor() → self2::Class
     : super core::Object::•()
     ;
+  @#C1
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ missingOriginConstructor() → self2::Class
+    : super core::Object::•()
+    ;
   method existingOriginMethod() → void {}
   @#C1
   method /* from org-dartlang-testcase:///patch_lib.dart */ missingOriginMethod() → void {}
 }
+class existingOriginDeclaration#1#0 extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  synthetic constructor •() → self2::existingOriginDeclaration#1#0
+    : super core::Object::•()
+    ;
+}
+class ExistingOriginClass#1#0 extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  synthetic constructor •() → self2::ExistingOriginClass#1#0
+    : super core::Object::•()
+    ;
+}
 class ExistingOriginClass extends core::Object {
   synthetic constructor •() → self2::ExistingOriginClass
     : super core::Object::•()
     ;
 }
 @#C1
+class _#MissingOriginClass#augmentationWithoutOrigin0 extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  synthetic constructor •() → self2::_#MissingOriginClass#augmentationWithoutOrigin0
+    : super core::Object::•()
+    ;
+}
+@#C1
 extension MissingOriginExtension on core::int { // from org-dartlang-testcase:///patch_lib.dart
 }
 static method existingOriginMethod() → void {}
 static method existingOriginDeclaration() → void {}
 @#C1
 static method /* from org-dartlang-testcase:///patch_lib.dart */ missingOriginMethod() → void {}
-static method /* from org-dartlang-testcase:///patch_lib.dart */ existingOriginMethod#1() → void {}
 
 constants  {
   #C1 = _in::_Patch {}
diff --git a/pkg/front_end/testcases/general/patch_conflict/main.dart.strong.outline.expect b/pkg/front_end/testcases/general/patch_conflict/main.dart.strong.outline.expect
index d0b30cb..5e56c1b 100644
--- a/pkg/front_end/testcases/general/patch_conflict/main.dart.strong.outline.expect
+++ b/pkg/front_end/testcases/general/patch_conflict/main.dart.strong.outline.expect
@@ -10,70 +10,95 @@
 //
 // Problems in library:
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:16:8: Error: Patch member 'missingOriginMethod' doesn't match a member in the origin class.
-// Try changing the name to an existing member or removing the '@patch' annotation.
-//   void missingOriginMethod() {} /* Error: missing origin method */
-//        ^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:30:6: Error: 'existingOriginMethod' is already declared in this scope.
+// void existingOriginMethod() {} /* Error: conflict with origin method */
+//      ^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:13:6: Context: Previous declaration of 'existingOriginMethod'.
+// void existingOriginMethod() {}
+//      ^^^^^^^^^^^^^^^^^^^^
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:18:8: Error: Member 'existingOriginMethod' conflicts with an existing member of the same name in the origin class.
-// Try changing the name of the member or adding an '@patch' annotation.
-//   void existingOriginMethod() {} /* Error: conflict with origin method */
-//        ^^^^^^^^^^^^^^^^^^^^
-// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:10:8: Context: This is the existing member.
-//   void existingOriginMethod() {}
-//        ^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:30:6: Error: Can't inject public 'existingOriginMethod' into 'dart:test'.
+// Make 'existingOriginMethod' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+// void existingOriginMethod() {} /* Error: conflict with origin method */
+//      ^
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:11:3: Error: Patch constructor 'Class.missingOriginConstructor' doesn't match a constructor in the origin class.
-// Try changing the name to an existing constructor or removing the '@patch' annotation.
-//   Class.missingOriginConstructor(); /* Error: missing origin class */
-//   ^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:32:7: Error: 'existingOriginDeclaration' is already declared in this scope.
+// class existingOriginDeclaration {} /* Error: conflict with origin declaration */
+//       ^^^^^^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:15:6: Context: Previous declaration of 'existingOriginDeclaration'.
+// void existingOriginDeclaration() {}
+//      ^^^^^^^^^^^^^^^^^^^^^^^^^
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:13:3: Error: Constructor 'Class.existingOriginConstructor' conflicts with an existing constructor of the same name in the origin class.
-// Try changing the name of the constructor or adding an '@patch' annotation.
-//   Class.existingOriginConstructor(); /* Error: conflict with origin class */
-//   ^
-// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:8:3: Context: This is the existing constructor.
-//   Class.existingOriginConstructor();
-//   ^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:32:7: Error: Can't inject public 'existingOriginDeclaration' into 'dart:test'.
+// Make 'existingOriginDeclaration' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+// class existingOriginDeclaration {} /* Error: conflict with origin declaration */
+//       ^
+//
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:34:7: Error: 'ExistingOriginClass' is already declared in this scope.
+// class ExistingOriginClass {} /* Error: conflict with origin class */
+//       ^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:17:7: Context: Previous declaration of 'ExistingOriginClass'.
+// class ExistingOriginClass {}
+//       ^^^^^^^^^^^^^^^^^^^
+//
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:34:7: Error: Can't inject public 'ExistingOriginClass' into 'dart:test'.
+// Make 'ExistingOriginClass' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+// class ExistingOriginClass {} /* Error: conflict with origin class */
+//       ^
 //
 // pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:22:6: Error: Patch member 'missingOriginMethod' doesn't match a member in the origin library.
 // Try changing the name to an existing member or removing the '@patch' annotation.
 // void missingOriginMethod() {} /* Error: missing origin method */
-//      ^^^^^^^^^^^^^^^^^^^
+//      ^
+//
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:22:6: Error: Can't inject public 'missingOriginMethod' into 'dart:test'.
+// Make 'missingOriginMethod' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+// void missingOriginMethod() {} /* Error: missing origin method */
+//      ^
 //
 // pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:25:7: Error: Patch class 'MissingOriginClass' doesn't match a class in the origin library.
 // Try changing the name to an existing class or removing the '@patch' annotation.
 // class MissingOriginClass {} /* Error: missing origin class */
-//       ^^^^^^^^^^^^^^^^^^
+//       ^
+//
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:25:7: Error: Can't inject public 'MissingOriginClass' into 'dart:test'.
+// Make 'MissingOriginClass' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+// class MissingOriginClass {} /* Error: missing origin class */
+//       ^
 //
 // pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:28:11: Error: Patch 'MissingOriginExtension' doesn't match a declaration in the origin library.
 // Try changing the name to an existing declaration or removing the '@patch' annotation.
 // extension MissingOriginExtension on int {} /* Error: missing origin extension */
-//           ^^^^^^^^^^^^^^^^^^^^^^
+//           ^
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:30:6: Error: Member 'existingOriginMethod' conflicts with an existing member of the same name in the origin library.
-// Try changing the name of the member or adding an '@patch' annotation.
-// void existingOriginMethod() {} /* Error: conflict with origin method */
-//      ^^^^^^^^^^^^^^^^^^^^
-// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:13:6: Context: This is the existing member.
-// void existingOriginMethod() {}
-//      ^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:28:11: Error: Can't inject public 'MissingOriginExtension' into 'dart:test'.
+// Make 'MissingOriginExtension' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+// extension MissingOriginExtension on int {} /* Error: missing origin extension */
+//           ^
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:32:7: Error: Declaration 'existingOriginDeclaration' conflicts with an existing declaration of the same name in the origin library.
-// Try changing the name of the declaration.
-// class existingOriginDeclaration {} /* Error: conflict with origin declaration */
-//       ^^^^^^^^^^^^^^^^^^^^^^^^^
-// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:15:6: Context: This is the existing member.
-// void existingOriginDeclaration() {}
-//      ^^^^^^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:13:3: Error: 'Class.existingOriginConstructor' is already declared in this scope.
+//   Class.existingOriginConstructor(); /* Error: conflict with origin class */
+//   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:8:3: Context: Previous declaration of 'Class.existingOriginConstructor'.
+//   Class.existingOriginConstructor();
+//   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:34:7: Error: Class 'ExistingOriginClass' conflicts with an existing class of the same name in the origin library.
-// Try changing the name of the class or adding an '@patch' annotation.
-// class ExistingOriginClass {} /* Error: conflict with origin class */
-//       ^^^^^^^^^^^^^^^^^^^
-// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:17:7: Context: This is the existing class.
-// class ExistingOriginClass {}
-//       ^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:18:8: Error: 'existingOriginMethod' is already declared in this scope.
+//   void existingOriginMethod() {} /* Error: conflict with origin method */
+//        ^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:10:8: Context: Previous declaration of 'existingOriginMethod'.
+//   void existingOriginMethod() {}
+//        ^^^^^^^^^^^^^^^^^^^^
+//
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:11:3: Error: Patch member 'missingOriginConstructor' doesn't match a member in the origin class.
+// Try changing the name to an existing member or removing the '@patch' annotation.
+//   Class.missingOriginConstructor(); /* Error: missing origin class */
+//   ^
+//
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:16:8: Error: Patch member 'missingOriginMethod' doesn't match a member in the origin class.
+// Try changing the name to an existing member or removing the '@patch' annotation.
+//   void missingOriginMethod() {} /* Error: missing origin method */
+//        ^
 //
 import self as self2;
 import "dart:_internal" as _in;
@@ -81,39 +106,39 @@
 
 import "dart:_internal";
 
-@_in::patch
-class MissingOriginClass extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
-  synthetic constructor •() → self2::MissingOriginClass
-    ;
-}
-class existingOriginDeclaration#0#1 extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
-  synthetic constructor •() → self2::existingOriginDeclaration#0#1
-    ;
-}
-class ExistingOriginClass#0#1 extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
-  synthetic constructor •() → self2::ExistingOriginClass#0#1
-    ;
-}
 @/* from org-dartlang-testcase:///patch_lib.dart */ _in::patch
 class Class extends core::Object {
-  @_in::patch
-  constructor /* from org-dartlang-testcase:///patch_lib.dart */ missingOriginConstructor() → self2::Class
-    ;
   constructor •() → self2::Class
     ;
   constructor existingOriginConstructor() → self2::Class
     ;
+  @_in::patch
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ missingOriginConstructor() → self2::Class
+    ;
   method existingOriginMethod() → void
     ;
   @_in::patch
   method /* from org-dartlang-testcase:///patch_lib.dart */ missingOriginMethod() → void
     ;
 }
+class existingOriginDeclaration#1#0 extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  synthetic constructor •() → self2::existingOriginDeclaration#1#0
+    ;
+}
+class ExistingOriginClass#1#0 extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  synthetic constructor •() → self2::ExistingOriginClass#1#0
+    ;
+}
 class ExistingOriginClass extends core::Object {
   synthetic constructor •() → self2::ExistingOriginClass
     ;
 }
 @_in::patch
+class _#MissingOriginClass#augmentationWithoutOrigin0 extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  synthetic constructor •() → self2::_#MissingOriginClass#augmentationWithoutOrigin0
+    ;
+}
+@_in::patch
 extension MissingOriginExtension on core::int { // from org-dartlang-testcase:///patch_lib.dart
 }
 static method existingOriginMethod() → void
@@ -123,15 +148,13 @@
 @_in::patch
 static method /* from org-dartlang-testcase:///patch_lib.dart */ missingOriginMethod() → void
   ;
-static method /* from org-dartlang-testcase:///patch_lib.dart */ existingOriginMethod#1() → void
-  ;
 
 
 Extra constant evaluation status:
-Evaluated: StaticGet @ org-dartlang-testcase:///patch_lib.dart:24:2 -> InstanceConstant(const _Patch{})
 Evaluated: FileUriExpression @ org-dartlang-testcase:///patch_lib.dart:8:1 -> InstanceConstant(const _Patch{})
 Evaluated: StaticGet @ org-dartlang-testcase:///patch_lib.dart:10:4 -> InstanceConstant(const _Patch{})
 Evaluated: StaticGet @ org-dartlang-testcase:///patch_lib.dart:15:4 -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ org-dartlang-testcase:///patch_lib.dart:24:2 -> InstanceConstant(const _Patch{})
 Evaluated: StaticGet @ org-dartlang-testcase:///patch_lib.dart:27:2 -> InstanceConstant(const _Patch{})
 Evaluated: StaticGet @ org-dartlang-testcase:///patch_lib.dart:21:2 -> InstanceConstant(const _Patch{})
 Extra constant evaluation: evaluated: 6, effectively constant: 6
diff --git a/pkg/front_end/testcases/general/patch_conflict/main.dart.strong.transformed.expect b/pkg/front_end/testcases/general/patch_conflict/main.dart.strong.transformed.expect
index ca13ee5..cc2093c 100644
--- a/pkg/front_end/testcases/general/patch_conflict/main.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/patch_conflict/main.dart.strong.transformed.expect
@@ -9,70 +9,95 @@
 //
 // Problems in library:
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:16:8: Error: Patch member 'missingOriginMethod' doesn't match a member in the origin class.
-// Try changing the name to an existing member or removing the '@patch' annotation.
-//   void missingOriginMethod() {} /* Error: missing origin method */
-//        ^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:30:6: Error: 'existingOriginMethod' is already declared in this scope.
+// void existingOriginMethod() {} /* Error: conflict with origin method */
+//      ^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:13:6: Context: Previous declaration of 'existingOriginMethod'.
+// void existingOriginMethod() {}
+//      ^^^^^^^^^^^^^^^^^^^^
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:18:8: Error: Member 'existingOriginMethod' conflicts with an existing member of the same name in the origin class.
-// Try changing the name of the member or adding an '@patch' annotation.
-//   void existingOriginMethod() {} /* Error: conflict with origin method */
-//        ^^^^^^^^^^^^^^^^^^^^
-// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:10:8: Context: This is the existing member.
-//   void existingOriginMethod() {}
-//        ^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:30:6: Error: Can't inject public 'existingOriginMethod' into 'dart:test'.
+// Make 'existingOriginMethod' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+// void existingOriginMethod() {} /* Error: conflict with origin method */
+//      ^
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:11:3: Error: Patch constructor 'Class.missingOriginConstructor' doesn't match a constructor in the origin class.
-// Try changing the name to an existing constructor or removing the '@patch' annotation.
-//   Class.missingOriginConstructor(); /* Error: missing origin class */
-//   ^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:32:7: Error: 'existingOriginDeclaration' is already declared in this scope.
+// class existingOriginDeclaration {} /* Error: conflict with origin declaration */
+//       ^^^^^^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:15:6: Context: Previous declaration of 'existingOriginDeclaration'.
+// void existingOriginDeclaration() {}
+//      ^^^^^^^^^^^^^^^^^^^^^^^^^
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:13:3: Error: Constructor 'Class.existingOriginConstructor' conflicts with an existing constructor of the same name in the origin class.
-// Try changing the name of the constructor or adding an '@patch' annotation.
-//   Class.existingOriginConstructor(); /* Error: conflict with origin class */
-//   ^
-// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:8:3: Context: This is the existing constructor.
-//   Class.existingOriginConstructor();
-//   ^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:32:7: Error: Can't inject public 'existingOriginDeclaration' into 'dart:test'.
+// Make 'existingOriginDeclaration' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+// class existingOriginDeclaration {} /* Error: conflict with origin declaration */
+//       ^
+//
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:34:7: Error: 'ExistingOriginClass' is already declared in this scope.
+// class ExistingOriginClass {} /* Error: conflict with origin class */
+//       ^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:17:7: Context: Previous declaration of 'ExistingOriginClass'.
+// class ExistingOriginClass {}
+//       ^^^^^^^^^^^^^^^^^^^
+//
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:34:7: Error: Can't inject public 'ExistingOriginClass' into 'dart:test'.
+// Make 'ExistingOriginClass' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+// class ExistingOriginClass {} /* Error: conflict with origin class */
+//       ^
 //
 // pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:22:6: Error: Patch member 'missingOriginMethod' doesn't match a member in the origin library.
 // Try changing the name to an existing member or removing the '@patch' annotation.
 // void missingOriginMethod() {} /* Error: missing origin method */
-//      ^^^^^^^^^^^^^^^^^^^
+//      ^
+//
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:22:6: Error: Can't inject public 'missingOriginMethod' into 'dart:test'.
+// Make 'missingOriginMethod' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+// void missingOriginMethod() {} /* Error: missing origin method */
+//      ^
 //
 // pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:25:7: Error: Patch class 'MissingOriginClass' doesn't match a class in the origin library.
 // Try changing the name to an existing class or removing the '@patch' annotation.
 // class MissingOriginClass {} /* Error: missing origin class */
-//       ^^^^^^^^^^^^^^^^^^
+//       ^
+//
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:25:7: Error: Can't inject public 'MissingOriginClass' into 'dart:test'.
+// Make 'MissingOriginClass' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+// class MissingOriginClass {} /* Error: missing origin class */
+//       ^
 //
 // pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:28:11: Error: Patch 'MissingOriginExtension' doesn't match a declaration in the origin library.
 // Try changing the name to an existing declaration or removing the '@patch' annotation.
 // extension MissingOriginExtension on int {} /* Error: missing origin extension */
-//           ^^^^^^^^^^^^^^^^^^^^^^
+//           ^
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:30:6: Error: Member 'existingOriginMethod' conflicts with an existing member of the same name in the origin library.
-// Try changing the name of the member or adding an '@patch' annotation.
-// void existingOriginMethod() {} /* Error: conflict with origin method */
-//      ^^^^^^^^^^^^^^^^^^^^
-// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:13:6: Context: This is the existing member.
-// void existingOriginMethod() {}
-//      ^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:28:11: Error: Can't inject public 'MissingOriginExtension' into 'dart:test'.
+// Make 'MissingOriginExtension' private, or make sure injected library has "dart" scheme and is private (e.g. "dart:_internal").
+// extension MissingOriginExtension on int {} /* Error: missing origin extension */
+//           ^
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:32:7: Error: Declaration 'existingOriginDeclaration' conflicts with an existing declaration of the same name in the origin library.
-// Try changing the name of the declaration.
-// class existingOriginDeclaration {} /* Error: conflict with origin declaration */
-//       ^^^^^^^^^^^^^^^^^^^^^^^^^
-// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:15:6: Context: This is the existing member.
-// void existingOriginDeclaration() {}
-//      ^^^^^^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:13:3: Error: 'Class.existingOriginConstructor' is already declared in this scope.
+//   Class.existingOriginConstructor(); /* Error: conflict with origin class */
+//   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:8:3: Context: Previous declaration of 'Class.existingOriginConstructor'.
+//   Class.existingOriginConstructor();
+//   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 //
-// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:34:7: Error: Class 'ExistingOriginClass' conflicts with an existing class of the same name in the origin library.
-// Try changing the name of the class or adding an '@patch' annotation.
-// class ExistingOriginClass {} /* Error: conflict with origin class */
-//       ^^^^^^^^^^^^^^^^^^^
-// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:17:7: Context: This is the existing class.
-// class ExistingOriginClass {}
-//       ^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:18:8: Error: 'existingOriginMethod' is already declared in this scope.
+//   void existingOriginMethod() {} /* Error: conflict with origin method */
+//        ^^^^^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/general/patch_conflict/origin_lib.dart:10:8: Context: Previous declaration of 'existingOriginMethod'.
+//   void existingOriginMethod() {}
+//        ^^^^^^^^^^^^^^^^^^^^
+//
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:11:3: Error: Patch member 'missingOriginConstructor' doesn't match a member in the origin class.
+// Try changing the name to an existing member or removing the '@patch' annotation.
+//   Class.missingOriginConstructor(); /* Error: missing origin class */
+//   ^
+//
+// pkg/front_end/testcases/general/patch_conflict/patch_lib.dart:16:8: Error: Patch member 'missingOriginMethod' doesn't match a member in the origin class.
+// Try changing the name to an existing member or removing the '@patch' annotation.
+//   void missingOriginMethod() {} /* Error: missing origin method */
+//        ^
 //
 import self as self2;
 import "dart:_internal" as _in;
@@ -80,51 +105,50 @@
 
 import "dart:_internal";
 
-@#C1
-class MissingOriginClass extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
-  synthetic constructor •() → self2::MissingOriginClass
-    : super core::Object::•()
-    ;
-}
-class existingOriginDeclaration#0#1 extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
-  synthetic constructor •() → self2::existingOriginDeclaration#0#1
-    : super core::Object::•()
-    ;
-}
-class ExistingOriginClass#0#1 extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
-  synthetic constructor •() → self2::ExistingOriginClass#0#1
-    : super core::Object::•()
-    ;
-}
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C1
 class Class extends core::Object {
-  @#C1
-  constructor /* from org-dartlang-testcase:///patch_lib.dart */ missingOriginConstructor() → self2::Class
-    : super core::Object::•()
-    ;
   constructor •() → self2::Class
     : super core::Object::•()
     ;
   constructor existingOriginConstructor() → self2::Class
     : super core::Object::•()
     ;
+  @#C1
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ missingOriginConstructor() → self2::Class
+    : super core::Object::•()
+    ;
   method existingOriginMethod() → void {}
   @#C1
   method /* from org-dartlang-testcase:///patch_lib.dart */ missingOriginMethod() → void {}
 }
+class existingOriginDeclaration#1#0 extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  synthetic constructor •() → self2::existingOriginDeclaration#1#0
+    : super core::Object::•()
+    ;
+}
+class ExistingOriginClass#1#0 extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  synthetic constructor •() → self2::ExistingOriginClass#1#0
+    : super core::Object::•()
+    ;
+}
 class ExistingOriginClass extends core::Object {
   synthetic constructor •() → self2::ExistingOriginClass
     : super core::Object::•()
     ;
 }
 @#C1
+class _#MissingOriginClass#augmentationWithoutOrigin0 extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  synthetic constructor •() → self2::_#MissingOriginClass#augmentationWithoutOrigin0
+    : super core::Object::•()
+    ;
+}
+@#C1
 extension MissingOriginExtension on core::int { // from org-dartlang-testcase:///patch_lib.dart
 }
 static method existingOriginMethod() → void {}
 static method existingOriginDeclaration() → void {}
 @#C1
 static method /* from org-dartlang-testcase:///patch_lib.dart */ missingOriginMethod() → void {}
-static method /* from org-dartlang-testcase:///patch_lib.dart */ existingOriginMethod#1() → void {}
 
 constants  {
   #C1 = _in::_Patch {}
diff --git a/pkg/front_end/testcases/general/patch_extends_implements/main.dart.strong.expect b/pkg/front_end/testcases/general/patch_extends_implements/main.dart.strong.expect
index e04ff99..b93dd24 100644
--- a/pkg/front_end/testcases/general/patch_extends_implements/main.dart.strong.expect
+++ b/pkg/front_end/testcases/general/patch_extends_implements/main.dart.strong.expect
@@ -86,26 +86,6 @@
 
 import "dart:_internal";
 
-class _Class6aImpl<T extends core::Object? = dynamic> extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
-  constructor •((test::_Class6aImpl::T%) → void f) → test::_Class6aImpl<test::_Class6aImpl::T%>
-    : super core::Object::•()
-    ;
-}
-class _Class6bImpl<T extends core::Object? = dynamic> extends core::Object implements test::Class6b<test::_Class6bImpl::T%> { // from org-dartlang-testcase:///patch_lib.dart
-  constructor •((test::_Class6bImpl::T%) → void f) → test::_Class6bImpl<test::_Class6bImpl::T%>
-    : super core::Object::•()
-    ;
-}
-class _Class6cImpl<T extends core::Object? = dynamic> extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
-  constructor •((test::_Class6cImpl::T%) → void f) → test::_Class6cImpl<test::_Class6cImpl::T%>
-    : super core::Object::•()
-    ;
-}
-abstract class _Class4b&Object&Mixin = core::Object with test::Mixin /*isAnonymousMixin,hasConstConstructor*/  { // from org-dartlang-testcase:///patch_lib.dart
-  const synthetic constructor •() → test::_Class4b&Object&Mixin
-    : super core::Object::•()
-    ;
-}
 abstract class Interface extends core::Object {
   synthetic constructor •() → test::Interface
     : super core::Object::•()
@@ -236,6 +216,21 @@
   factory Class6c(void Function(T) f) = _Class6cImpl<T>;
                                         ^";
 }
+class _Class6aImpl<T extends core::Object? = dynamic> extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  constructor •((test::_Class6aImpl::T%) → void f) → test::_Class6aImpl<test::_Class6aImpl::T%>
+    : super core::Object::•()
+    ;
+}
+class _Class6bImpl<T extends core::Object? = dynamic> extends core::Object implements test::Class6b<test::_Class6bImpl::T%> { // from org-dartlang-testcase:///patch_lib.dart
+  constructor •((test::_Class6bImpl::T%) → void f) → test::_Class6bImpl<test::_Class6bImpl::T%>
+    : super core::Object::•()
+    ;
+}
+class _Class6cImpl<T extends core::Object? = dynamic> extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  constructor •((test::_Class6cImpl::T%) → void f) → test::_Class6cImpl<test::_Class6cImpl::T%>
+    : super core::Object::•()
+    ;
+}
 abstract class _Class4a&Object&Mixin = core::Object with test::Mixin /*isAnonymousMixin,hasConstConstructor*/  {
   const synthetic constructor •() → test::_Class4a&Object&Mixin
     : super core::Object::•()
diff --git a/pkg/front_end/testcases/general/patch_extends_implements/main.dart.strong.modular.expect b/pkg/front_end/testcases/general/patch_extends_implements/main.dart.strong.modular.expect
index e04ff99..b93dd24 100644
--- a/pkg/front_end/testcases/general/patch_extends_implements/main.dart.strong.modular.expect
+++ b/pkg/front_end/testcases/general/patch_extends_implements/main.dart.strong.modular.expect
@@ -86,26 +86,6 @@
 
 import "dart:_internal";
 
-class _Class6aImpl<T extends core::Object? = dynamic> extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
-  constructor •((test::_Class6aImpl::T%) → void f) → test::_Class6aImpl<test::_Class6aImpl::T%>
-    : super core::Object::•()
-    ;
-}
-class _Class6bImpl<T extends core::Object? = dynamic> extends core::Object implements test::Class6b<test::_Class6bImpl::T%> { // from org-dartlang-testcase:///patch_lib.dart
-  constructor •((test::_Class6bImpl::T%) → void f) → test::_Class6bImpl<test::_Class6bImpl::T%>
-    : super core::Object::•()
-    ;
-}
-class _Class6cImpl<T extends core::Object? = dynamic> extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
-  constructor •((test::_Class6cImpl::T%) → void f) → test::_Class6cImpl<test::_Class6cImpl::T%>
-    : super core::Object::•()
-    ;
-}
-abstract class _Class4b&Object&Mixin = core::Object with test::Mixin /*isAnonymousMixin,hasConstConstructor*/  { // from org-dartlang-testcase:///patch_lib.dart
-  const synthetic constructor •() → test::_Class4b&Object&Mixin
-    : super core::Object::•()
-    ;
-}
 abstract class Interface extends core::Object {
   synthetic constructor •() → test::Interface
     : super core::Object::•()
@@ -236,6 +216,21 @@
   factory Class6c(void Function(T) f) = _Class6cImpl<T>;
                                         ^";
 }
+class _Class6aImpl<T extends core::Object? = dynamic> extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  constructor •((test::_Class6aImpl::T%) → void f) → test::_Class6aImpl<test::_Class6aImpl::T%>
+    : super core::Object::•()
+    ;
+}
+class _Class6bImpl<T extends core::Object? = dynamic> extends core::Object implements test::Class6b<test::_Class6bImpl::T%> { // from org-dartlang-testcase:///patch_lib.dart
+  constructor •((test::_Class6bImpl::T%) → void f) → test::_Class6bImpl<test::_Class6bImpl::T%>
+    : super core::Object::•()
+    ;
+}
+class _Class6cImpl<T extends core::Object? = dynamic> extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  constructor •((test::_Class6cImpl::T%) → void f) → test::_Class6cImpl<test::_Class6cImpl::T%>
+    : super core::Object::•()
+    ;
+}
 abstract class _Class4a&Object&Mixin = core::Object with test::Mixin /*isAnonymousMixin,hasConstConstructor*/  {
   const synthetic constructor •() → test::_Class4a&Object&Mixin
     : super core::Object::•()
diff --git a/pkg/front_end/testcases/general/patch_extends_implements/main.dart.strong.outline.expect b/pkg/front_end/testcases/general/patch_extends_implements/main.dart.strong.outline.expect
index c07b92d..166cfb4 100644
--- a/pkg/front_end/testcases/general/patch_extends_implements/main.dart.strong.outline.expect
+++ b/pkg/front_end/testcases/general/patch_extends_implements/main.dart.strong.outline.expect
@@ -40,23 +40,6 @@
 
 import "dart:_internal";
 
-class _Class6aImpl<T extends core::Object? = dynamic> extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
-  constructor •((self2::_Class6aImpl::T%) → void f) → self2::_Class6aImpl<self2::_Class6aImpl::T%>
-    ;
-}
-class _Class6bImpl<T extends core::Object? = dynamic> extends core::Object implements self2::Class6b<self2::_Class6bImpl::T%> { // from org-dartlang-testcase:///patch_lib.dart
-  constructor •((self2::_Class6bImpl::T%) → void f) → self2::_Class6bImpl<self2::_Class6bImpl::T%>
-    ;
-}
-class _Class6cImpl<T extends core::Object? = dynamic> extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
-  constructor •((self2::_Class6cImpl::T%) → void f) → self2::_Class6cImpl<self2::_Class6cImpl::T%>
-    ;
-}
-abstract class _Class4b&Object&Mixin = core::Object with self2::Mixin /*isAnonymousMixin,hasConstConstructor*/  { // from org-dartlang-testcase:///patch_lib.dart
-  const synthetic constructor •() → self2::_Class4b&Object&Mixin
-    : super core::Object::•()
-    ;
-}
 abstract class Interface extends core::Object {
   synthetic constructor •() → self2::Interface
     ;
@@ -158,6 +141,18 @@
   external static factory •<T extends core::Object? = dynamic>((self2::Class6c::•::T%) → void f) → self2::Class6c<self2::Class6c::•::T%>
     return new self2::_Class6cImpl::•<self2::Class6c::•::T%>(f);
 }
+class _Class6aImpl<T extends core::Object? = dynamic> extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  constructor •((self2::_Class6aImpl::T%) → void f) → self2::_Class6aImpl<self2::_Class6aImpl::T%>
+    ;
+}
+class _Class6bImpl<T extends core::Object? = dynamic> extends core::Object implements self2::Class6b<self2::_Class6bImpl::T%> { // from org-dartlang-testcase:///patch_lib.dart
+  constructor •((self2::_Class6bImpl::T%) → void f) → self2::_Class6bImpl<self2::_Class6bImpl::T%>
+    ;
+}
+class _Class6cImpl<T extends core::Object? = dynamic> extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  constructor •((self2::_Class6cImpl::T%) → void f) → self2::_Class6cImpl<self2::_Class6cImpl::T%>
+    ;
+}
 abstract class _Class4a&Object&Mixin = core::Object with self2::Mixin /*isAnonymousMixin,hasConstConstructor*/  {
   const synthetic constructor •() → self2::_Class4a&Object&Mixin
     : super core::Object::•()
diff --git a/pkg/front_end/testcases/general/patch_extends_implements/main.dart.strong.transformed.expect b/pkg/front_end/testcases/general/patch_extends_implements/main.dart.strong.transformed.expect
index 676db98..6d00291 100644
--- a/pkg/front_end/testcases/general/patch_extends_implements/main.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/patch_extends_implements/main.dart.strong.transformed.expect
@@ -86,26 +86,6 @@
 
 import "dart:_internal";
 
-class _Class6aImpl<T extends core::Object? = dynamic> extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
-  constructor •((test::_Class6aImpl::T%) → void f) → test::_Class6aImpl<test::_Class6aImpl::T%>
-    : super core::Object::•()
-    ;
-}
-class _Class6bImpl<T extends core::Object? = dynamic> extends core::Object implements test::Class6b<test::_Class6bImpl::T%> { // from org-dartlang-testcase:///patch_lib.dart
-  constructor •((test::_Class6bImpl::T%) → void f) → test::_Class6bImpl<test::_Class6bImpl::T%>
-    : super core::Object::•()
-    ;
-}
-class _Class6cImpl<T extends core::Object? = dynamic> extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
-  constructor •((test::_Class6cImpl::T%) → void f) → test::_Class6cImpl<test::_Class6cImpl::T%>
-    : super core::Object::•()
-    ;
-}
-abstract class _Class4b&Object&Mixin extends core::Object implements test::Mixin /*isAnonymousMixin,isEliminatedMixin,hasConstConstructor*/  { // from org-dartlang-testcase:///patch_lib.dart
-  const synthetic constructor •() → test::_Class4b&Object&Mixin
-    : super core::Object::•()
-    ;
-}
 abstract class Interface extends core::Object {
   synthetic constructor •() → test::Interface
     : super core::Object::•()
@@ -236,6 +216,21 @@
   factory Class6c(void Function(T) f) = _Class6cImpl<T>;
                                         ^";
 }
+class _Class6aImpl<T extends core::Object? = dynamic> extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  constructor •((test::_Class6aImpl::T%) → void f) → test::_Class6aImpl<test::_Class6aImpl::T%>
+    : super core::Object::•()
+    ;
+}
+class _Class6bImpl<T extends core::Object? = dynamic> extends core::Object implements test::Class6b<test::_Class6bImpl::T%> { // from org-dartlang-testcase:///patch_lib.dart
+  constructor •((test::_Class6bImpl::T%) → void f) → test::_Class6bImpl<test::_Class6bImpl::T%>
+    : super core::Object::•()
+    ;
+}
+class _Class6cImpl<T extends core::Object? = dynamic> extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  constructor •((test::_Class6cImpl::T%) → void f) → test::_Class6cImpl<test::_Class6cImpl::T%>
+    : super core::Object::•()
+    ;
+}
 abstract class _Class4a&Object&Mixin extends core::Object implements test::Mixin /*isAnonymousMixin,isEliminatedMixin,hasConstConstructor*/  {
   const synthetic constructor •() → test::_Class4a&Object&Mixin
     : super core::Object::•()
diff --git a/pkg/front_end/testcases/general/patch_extension_scope/main.dart.strong.expect b/pkg/front_end/testcases/general/patch_extension_scope/main.dart.strong.expect
index 2d098ec..a8dc68c 100644
--- a/pkg/front_end/testcases/general/patch_extension_scope/main.dart.strong.expect
+++ b/pkg/front_end/testcases/general/patch_extension_scope/main.dart.strong.expect
@@ -147,95 +147,95 @@
   method _method() → void {
     test::Extension|namedExtensionMethod(this);
     test::Extension|_namedExtensionPrivateMethod(this);
-    test::_extension#5|unnamedExtensionMethod(this);
-    test::_extension#5|_unnamedExtensionPrivateMethod(this);
+    test::_extension#3|unnamedExtensionMethod(this);
+    test::_extension#3|_unnamedExtensionPrivateMethod(this);
     test::NamedInjectedExtension1|namedInjectedExtensionMethod1(this);
     test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(this);
-    test::_extension#1|unnamedInjectedExtensionMethod1(this);
-    test::_extension#1|_unnamedInjectedExtensionPrivateMethod1(this);
+    test::_extension#4|unnamedInjectedExtensionMethod1(this);
+    test::_extension#4|_unnamedInjectedExtensionPrivateMethod1(this);
     test::NamedInjectedExtension2|namedInjectedExtensionMethod2(this);
     test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(this);
-    test::_extension#3|unnamedInjectedExtensionMethod2(this);
-    test::_extension#3|_unnamedInjectedExtensionPrivateMethod2(this);
+    test::_extension#5|unnamedInjectedExtensionMethod2(this);
+    test::_extension#5|_unnamedInjectedExtensionPrivateMethod2(this);
   }
   method /* from org-dartlang-testcase:///patch_lib1.dart */ _method1() → void {
     test::Extension|namedExtensionMethod(this);
     test::Extension|_namedExtensionPrivateMethod(this);
-    test::_extension#5|unnamedExtensionMethod(this);
-    test::_extension#5|_unnamedExtensionPrivateMethod(this);
+    test::_extension#3|unnamedExtensionMethod(this);
+    test::_extension#3|_unnamedExtensionPrivateMethod(this);
     test::NamedInjectedExtension1|namedInjectedExtensionMethod1(this);
     test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(this);
-    test::_extension#1|unnamedInjectedExtensionMethod1(this);
-    test::_extension#1|_unnamedInjectedExtensionPrivateMethod1(this);
+    test::_extension#4|unnamedInjectedExtensionMethod1(this);
+    test::_extension#4|_unnamedInjectedExtensionPrivateMethod1(this);
     test::NamedInjectedExtension2|namedInjectedExtensionMethod2(this);
     test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(this);
-    test::_extension#3|unnamedInjectedExtensionMethod2(this);
-    test::_extension#3|_unnamedInjectedExtensionPrivateMethod2(this);
+    test::_extension#5|unnamedInjectedExtensionMethod2(this);
+    test::_extension#5|_unnamedInjectedExtensionPrivateMethod2(this);
   }
   method /* from org-dartlang-testcase:///patch_lib2.dart */ _method2() → void {
     test::Extension|namedExtensionMethod(this);
     test::Extension|_namedExtensionPrivateMethod(this);
-    test::_extension#5|unnamedExtensionMethod(this);
-    test::_extension#5|_unnamedExtensionPrivateMethod(this);
+    test::_extension#3|unnamedExtensionMethod(this);
+    test::_extension#3|_unnamedExtensionPrivateMethod(this);
     test::NamedInjectedExtension1|namedInjectedExtensionMethod1(this);
     test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(this);
-    test::_extension#1|unnamedInjectedExtensionMethod1(this);
-    test::_extension#1|_unnamedInjectedExtensionPrivateMethod1(this);
+    test::_extension#4|unnamedInjectedExtensionMethod1(this);
+    test::_extension#4|_unnamedInjectedExtensionPrivateMethod1(this);
     test::NamedInjectedExtension2|namedInjectedExtensionMethod2(this);
     test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(this);
-    test::_extension#3|unnamedInjectedExtensionMethod2(this);
-    test::_extension#3|_unnamedInjectedExtensionPrivateMethod2(this);
+    test::_extension#5|unnamedInjectedExtensionMethod2(this);
+    test::_extension#5|_unnamedInjectedExtensionPrivateMethod2(this);
   }
 }
-extension NamedInjectedExtension1 on test::Class { // from org-dartlang-testcase:///patch_lib1.dart
-  method namedInjectedExtensionMethod1 = test::NamedInjectedExtension1|namedInjectedExtensionMethod1;
-  method tearoff namedInjectedExtensionMethod1 = test::NamedInjectedExtension1|get#namedInjectedExtensionMethod1;
-  method _namedInjectedExtensionPrivateMethod1 = test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1;
-  method tearoff _namedInjectedExtensionPrivateMethod1 = test::NamedInjectedExtension1|get#_namedInjectedExtensionPrivateMethod1;
-}
-extension /* unnamed */ _extension#1 on test::Class { // from org-dartlang-testcase:///patch_lib1.dart
-  method unnamedInjectedExtensionMethod1 = test::_extension#1|unnamedInjectedExtensionMethod1;
-  method tearoff unnamedInjectedExtensionMethod1 = test::_extension#1|get#unnamedInjectedExtensionMethod1;
-  method _unnamedInjectedExtensionPrivateMethod1 = test::_extension#1|_unnamedInjectedExtensionPrivateMethod1;
-  method tearoff _unnamedInjectedExtensionPrivateMethod1 = test::_extension#1|get#_unnamedInjectedExtensionPrivateMethod1;
-}
-extension NamedInjectedExtension2 on test::Class { // from org-dartlang-testcase:///patch_lib2.dart
-  method namedInjectedExtensionMethod2 = test::NamedInjectedExtension2|namedInjectedExtensionMethod2;
-  method tearoff namedInjectedExtensionMethod2 = test::NamedInjectedExtension2|get#namedInjectedExtensionMethod2;
-  method _namedInjectedExtensionPrivateMethod2 = test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2;
-  method tearoff _namedInjectedExtensionPrivateMethod2 = test::NamedInjectedExtension2|get#_namedInjectedExtensionPrivateMethod2;
-}
-extension /* unnamed */ _extension#3 on test::Class { // from org-dartlang-testcase:///patch_lib2.dart
-  method unnamedInjectedExtensionMethod2 = test::_extension#3|unnamedInjectedExtensionMethod2;
-  method tearoff unnamedInjectedExtensionMethod2 = test::_extension#3|get#unnamedInjectedExtensionMethod2;
-  method _unnamedInjectedExtensionPrivateMethod2 = test::_extension#3|_unnamedInjectedExtensionPrivateMethod2;
-  method tearoff _unnamedInjectedExtensionPrivateMethod2 = test::_extension#3|get#_unnamedInjectedExtensionPrivateMethod2;
-}
 extension Extension on test::Class {
   method namedExtensionMethod = test::Extension|namedExtensionMethod;
   method tearoff namedExtensionMethod = test::Extension|get#namedExtensionMethod;
   method _namedExtensionPrivateMethod = test::Extension|_namedExtensionPrivateMethod;
   method tearoff _namedExtensionPrivateMethod = test::Extension|get#_namedExtensionPrivateMethod;
 }
-extension /* unnamed */ _extension#5 on test::Class {
-  method unnamedExtensionMethod = test::_extension#5|unnamedExtensionMethod;
-  method tearoff unnamedExtensionMethod = test::_extension#5|get#unnamedExtensionMethod;
-  method _unnamedExtensionPrivateMethod = test::_extension#5|_unnamedExtensionPrivateMethod;
-  method tearoff _unnamedExtensionPrivateMethod = test::_extension#5|get#_unnamedExtensionPrivateMethod;
+extension NamedInjectedExtension1 on test::Class { // from org-dartlang-testcase:///patch_lib1.dart
+  method namedInjectedExtensionMethod1 = test::NamedInjectedExtension1|namedInjectedExtensionMethod1;
+  method tearoff namedInjectedExtensionMethod1 = test::NamedInjectedExtension1|get#namedInjectedExtensionMethod1;
+  method _namedInjectedExtensionPrivateMethod1 = test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1;
+  method tearoff _namedInjectedExtensionPrivateMethod1 = test::NamedInjectedExtension1|get#_namedInjectedExtensionPrivateMethod1;
+}
+extension NamedInjectedExtension2 on test::Class { // from org-dartlang-testcase:///patch_lib2.dart
+  method namedInjectedExtensionMethod2 = test::NamedInjectedExtension2|namedInjectedExtensionMethod2;
+  method tearoff namedInjectedExtensionMethod2 = test::NamedInjectedExtension2|get#namedInjectedExtensionMethod2;
+  method _namedInjectedExtensionPrivateMethod2 = test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2;
+  method tearoff _namedInjectedExtensionPrivateMethod2 = test::NamedInjectedExtension2|get#_namedInjectedExtensionPrivateMethod2;
+}
+extension /* unnamed */ _extension#3 on test::Class {
+  method unnamedExtensionMethod = test::_extension#3|unnamedExtensionMethod;
+  method tearoff unnamedExtensionMethod = test::_extension#3|get#unnamedExtensionMethod;
+  method _unnamedExtensionPrivateMethod = test::_extension#3|_unnamedExtensionPrivateMethod;
+  method tearoff _unnamedExtensionPrivateMethod = test::_extension#3|get#_unnamedExtensionPrivateMethod;
+}
+extension /* unnamed */ _extension#4 on test::Class { // from org-dartlang-testcase:///patch_lib1.dart
+  method unnamedInjectedExtensionMethod1 = test::_extension#4|unnamedInjectedExtensionMethod1;
+  method tearoff unnamedInjectedExtensionMethod1 = test::_extension#4|get#unnamedInjectedExtensionMethod1;
+  method _unnamedInjectedExtensionPrivateMethod1 = test::_extension#4|_unnamedInjectedExtensionPrivateMethod1;
+  method tearoff _unnamedInjectedExtensionPrivateMethod1 = test::_extension#4|get#_unnamedInjectedExtensionPrivateMethod1;
+}
+extension /* unnamed */ _extension#5 on test::Class { // from org-dartlang-testcase:///patch_lib2.dart
+  method unnamedInjectedExtensionMethod2 = test::_extension#5|unnamedInjectedExtensionMethod2;
+  method tearoff unnamedInjectedExtensionMethod2 = test::_extension#5|get#unnamedInjectedExtensionMethod2;
+  method _unnamedInjectedExtensionPrivateMethod2 = test::_extension#5|_unnamedInjectedExtensionPrivateMethod2;
+  method tearoff _unnamedInjectedExtensionPrivateMethod2 = test::_extension#5|get#_unnamedInjectedExtensionPrivateMethod2;
 }
 static method _method(test::Class c) → void {
   test::Extension|namedExtensionMethod(c);
   test::Extension|_namedExtensionPrivateMethod(c);
-  test::_extension#5|unnamedExtensionMethod(c);
-  test::_extension#5|_unnamedExtensionPrivateMethod(c);
+  test::_extension#3|unnamedExtensionMethod(c);
+  test::_extension#3|_unnamedExtensionPrivateMethod(c);
   test::NamedInjectedExtension1|namedInjectedExtensionMethod1(c);
   test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(c);
-  test::_extension#1|unnamedInjectedExtensionMethod1(c);
-  test::_extension#1|_unnamedInjectedExtensionPrivateMethod1(c);
+  test::_extension#4|unnamedInjectedExtensionMethod1(c);
+  test::_extension#4|_unnamedInjectedExtensionPrivateMethod1(c);
   test::NamedInjectedExtension2|namedInjectedExtensionMethod2(c);
   test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(c);
-  test::_extension#3|unnamedInjectedExtensionMethod2(c);
-  test::_extension#3|_unnamedInjectedExtensionPrivateMethod2(c);
+  test::_extension#5|unnamedInjectedExtensionMethod2(c);
+  test::_extension#5|_unnamedInjectedExtensionPrivateMethod2(c);
 }
 static extension-member method Extension|namedExtensionMethod(lowered final test::Class #this) → void {}
 static extension-member method Extension|get#namedExtensionMethod(lowered final test::Class #this) → () → void
@@ -243,25 +243,25 @@
 static extension-member method Extension|_namedExtensionPrivateMethod(lowered final test::Class #this) → void {}
 static extension-member method Extension|get#_namedExtensionPrivateMethod(lowered final test::Class #this) → () → void
   return () → void => test::Extension|_namedExtensionPrivateMethod(#this);
-static extension-member method _extension#5|unnamedExtensionMethod(lowered final test::Class #this) → void {}
-static extension-member method _extension#5|get#unnamedExtensionMethod(lowered final test::Class #this) → () → void
-  return () → void => test::_extension#5|unnamedExtensionMethod(#this);
-static extension-member method _extension#5|_unnamedExtensionPrivateMethod(lowered final test::Class #this) → void {}
-static extension-member method _extension#5|get#_unnamedExtensionPrivateMethod(lowered final test::Class #this) → () → void
-  return () → void => test::_extension#5|_unnamedExtensionPrivateMethod(#this);
+static extension-member method _extension#3|unnamedExtensionMethod(lowered final test::Class #this) → void {}
+static extension-member method _extension#3|get#unnamedExtensionMethod(lowered final test::Class #this) → () → void
+  return () → void => test::_extension#3|unnamedExtensionMethod(#this);
+static extension-member method _extension#3|_unnamedExtensionPrivateMethod(lowered final test::Class #this) → void {}
+static extension-member method _extension#3|get#_unnamedExtensionPrivateMethod(lowered final test::Class #this) → () → void
+  return () → void => test::_extension#3|_unnamedExtensionPrivateMethod(#this);
 static method /* from org-dartlang-testcase:///patch_lib1.dart */ _method1(test::Class c) → void {
   test::Extension|namedExtensionMethod(c);
   test::Extension|_namedExtensionPrivateMethod(c);
-  test::_extension#5|unnamedExtensionMethod(c);
-  test::_extension#5|_unnamedExtensionPrivateMethod(c);
+  test::_extension#3|unnamedExtensionMethod(c);
+  test::_extension#3|_unnamedExtensionPrivateMethod(c);
   test::NamedInjectedExtension1|namedInjectedExtensionMethod1(c);
   test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(c);
-  test::_extension#1|unnamedInjectedExtensionMethod1(c);
-  test::_extension#1|_unnamedInjectedExtensionPrivateMethod1(c);
+  test::_extension#4|unnamedInjectedExtensionMethod1(c);
+  test::_extension#4|_unnamedInjectedExtensionPrivateMethod1(c);
   test::NamedInjectedExtension2|namedInjectedExtensionMethod2(c);
   test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(c);
-  test::_extension#3|unnamedInjectedExtensionMethod2(c);
-  test::_extension#3|_unnamedInjectedExtensionPrivateMethod2(c);
+  test::_extension#5|unnamedInjectedExtensionMethod2(c);
+  test::_extension#5|_unnamedInjectedExtensionPrivateMethod2(c);
 }
 static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ NamedInjectedExtension1|namedInjectedExtensionMethod1(lowered final test::Class #this) → void {}
 static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ NamedInjectedExtension1|get#namedInjectedExtensionMethod1(lowered final test::Class #this) → () → void
@@ -269,25 +269,25 @@
 static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(lowered final test::Class #this) → void {}
 static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ NamedInjectedExtension1|get#_namedInjectedExtensionPrivateMethod1(lowered final test::Class #this) → () → void
   return () → void => test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(#this);
-static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#1|unnamedInjectedExtensionMethod1(lowered final test::Class #this) → void {}
-static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#1|get#unnamedInjectedExtensionMethod1(lowered final test::Class #this) → () → void
-  return () → void => test::_extension#1|unnamedInjectedExtensionMethod1(#this);
-static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#1|_unnamedInjectedExtensionPrivateMethod1(lowered final test::Class #this) → void {}
-static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#1|get#_unnamedInjectedExtensionPrivateMethod1(lowered final test::Class #this) → () → void
-  return () → void => test::_extension#1|_unnamedInjectedExtensionPrivateMethod1(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#4|unnamedInjectedExtensionMethod1(lowered final test::Class #this) → void {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#4|get#unnamedInjectedExtensionMethod1(lowered final test::Class #this) → () → void
+  return () → void => test::_extension#4|unnamedInjectedExtensionMethod1(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#4|_unnamedInjectedExtensionPrivateMethod1(lowered final test::Class #this) → void {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#4|get#_unnamedInjectedExtensionPrivateMethod1(lowered final test::Class #this) → () → void
+  return () → void => test::_extension#4|_unnamedInjectedExtensionPrivateMethod1(#this);
 static method /* from org-dartlang-testcase:///patch_lib2.dart */ _method2(test::Class c) → void {
   test::Extension|namedExtensionMethod(c);
   test::Extension|_namedExtensionPrivateMethod(c);
-  test::_extension#5|unnamedExtensionMethod(c);
-  test::_extension#5|_unnamedExtensionPrivateMethod(c);
+  test::_extension#3|unnamedExtensionMethod(c);
+  test::_extension#3|_unnamedExtensionPrivateMethod(c);
   test::NamedInjectedExtension1|namedInjectedExtensionMethod1(c);
   test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(c);
-  test::_extension#1|unnamedInjectedExtensionMethod1(c);
-  test::_extension#1|_unnamedInjectedExtensionPrivateMethod1(c);
+  test::_extension#4|unnamedInjectedExtensionMethod1(c);
+  test::_extension#4|_unnamedInjectedExtensionPrivateMethod1(c);
   test::NamedInjectedExtension2|namedInjectedExtensionMethod2(c);
   test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(c);
-  test::_extension#3|unnamedInjectedExtensionMethod2(c);
-  test::_extension#3|_unnamedInjectedExtensionPrivateMethod2(c);
+  test::_extension#5|unnamedInjectedExtensionMethod2(c);
+  test::_extension#5|_unnamedInjectedExtensionPrivateMethod2(c);
 }
 static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ NamedInjectedExtension2|namedInjectedExtensionMethod2(lowered final test::Class #this) → void {}
 static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ NamedInjectedExtension2|get#namedInjectedExtensionMethod2(lowered final test::Class #this) → () → void
@@ -295,12 +295,12 @@
 static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(lowered final test::Class #this) → void {}
 static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ NamedInjectedExtension2|get#_namedInjectedExtensionPrivateMethod2(lowered final test::Class #this) → () → void
   return () → void => test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(#this);
-static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#3|unnamedInjectedExtensionMethod2(lowered final test::Class #this) → void {}
-static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#3|get#unnamedInjectedExtensionMethod2(lowered final test::Class #this) → () → void
-  return () → void => test::_extension#3|unnamedInjectedExtensionMethod2(#this);
-static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#3|_unnamedInjectedExtensionPrivateMethod2(lowered final test::Class #this) → void {}
-static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#3|get#_unnamedInjectedExtensionPrivateMethod2(lowered final test::Class #this) → () → void
-  return () → void => test::_extension#3|_unnamedInjectedExtensionPrivateMethod2(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#5|unnamedInjectedExtensionMethod2(lowered final test::Class #this) → void {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#5|get#unnamedInjectedExtensionMethod2(lowered final test::Class #this) → () → void
+  return () → void => test::_extension#5|unnamedInjectedExtensionMethod2(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#5|_unnamedInjectedExtensionPrivateMethod2(lowered final test::Class #this) → void {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#5|get#_unnamedInjectedExtensionPrivateMethod2(lowered final test::Class #this) → () → void
+  return () → void => test::_extension#5|_unnamedInjectedExtensionPrivateMethod2(#this);
 
 constants  {
   #C1 = _in::_Patch {}
diff --git a/pkg/front_end/testcases/general/patch_extension_scope/main.dart.strong.modular.expect b/pkg/front_end/testcases/general/patch_extension_scope/main.dart.strong.modular.expect
index 2d098ec..a8dc68c 100644
--- a/pkg/front_end/testcases/general/patch_extension_scope/main.dart.strong.modular.expect
+++ b/pkg/front_end/testcases/general/patch_extension_scope/main.dart.strong.modular.expect
@@ -147,95 +147,95 @@
   method _method() → void {
     test::Extension|namedExtensionMethod(this);
     test::Extension|_namedExtensionPrivateMethod(this);
-    test::_extension#5|unnamedExtensionMethod(this);
-    test::_extension#5|_unnamedExtensionPrivateMethod(this);
+    test::_extension#3|unnamedExtensionMethod(this);
+    test::_extension#3|_unnamedExtensionPrivateMethod(this);
     test::NamedInjectedExtension1|namedInjectedExtensionMethod1(this);
     test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(this);
-    test::_extension#1|unnamedInjectedExtensionMethod1(this);
-    test::_extension#1|_unnamedInjectedExtensionPrivateMethod1(this);
+    test::_extension#4|unnamedInjectedExtensionMethod1(this);
+    test::_extension#4|_unnamedInjectedExtensionPrivateMethod1(this);
     test::NamedInjectedExtension2|namedInjectedExtensionMethod2(this);
     test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(this);
-    test::_extension#3|unnamedInjectedExtensionMethod2(this);
-    test::_extension#3|_unnamedInjectedExtensionPrivateMethod2(this);
+    test::_extension#5|unnamedInjectedExtensionMethod2(this);
+    test::_extension#5|_unnamedInjectedExtensionPrivateMethod2(this);
   }
   method /* from org-dartlang-testcase:///patch_lib1.dart */ _method1() → void {
     test::Extension|namedExtensionMethod(this);
     test::Extension|_namedExtensionPrivateMethod(this);
-    test::_extension#5|unnamedExtensionMethod(this);
-    test::_extension#5|_unnamedExtensionPrivateMethod(this);
+    test::_extension#3|unnamedExtensionMethod(this);
+    test::_extension#3|_unnamedExtensionPrivateMethod(this);
     test::NamedInjectedExtension1|namedInjectedExtensionMethod1(this);
     test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(this);
-    test::_extension#1|unnamedInjectedExtensionMethod1(this);
-    test::_extension#1|_unnamedInjectedExtensionPrivateMethod1(this);
+    test::_extension#4|unnamedInjectedExtensionMethod1(this);
+    test::_extension#4|_unnamedInjectedExtensionPrivateMethod1(this);
     test::NamedInjectedExtension2|namedInjectedExtensionMethod2(this);
     test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(this);
-    test::_extension#3|unnamedInjectedExtensionMethod2(this);
-    test::_extension#3|_unnamedInjectedExtensionPrivateMethod2(this);
+    test::_extension#5|unnamedInjectedExtensionMethod2(this);
+    test::_extension#5|_unnamedInjectedExtensionPrivateMethod2(this);
   }
   method /* from org-dartlang-testcase:///patch_lib2.dart */ _method2() → void {
     test::Extension|namedExtensionMethod(this);
     test::Extension|_namedExtensionPrivateMethod(this);
-    test::_extension#5|unnamedExtensionMethod(this);
-    test::_extension#5|_unnamedExtensionPrivateMethod(this);
+    test::_extension#3|unnamedExtensionMethod(this);
+    test::_extension#3|_unnamedExtensionPrivateMethod(this);
     test::NamedInjectedExtension1|namedInjectedExtensionMethod1(this);
     test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(this);
-    test::_extension#1|unnamedInjectedExtensionMethod1(this);
-    test::_extension#1|_unnamedInjectedExtensionPrivateMethod1(this);
+    test::_extension#4|unnamedInjectedExtensionMethod1(this);
+    test::_extension#4|_unnamedInjectedExtensionPrivateMethod1(this);
     test::NamedInjectedExtension2|namedInjectedExtensionMethod2(this);
     test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(this);
-    test::_extension#3|unnamedInjectedExtensionMethod2(this);
-    test::_extension#3|_unnamedInjectedExtensionPrivateMethod2(this);
+    test::_extension#5|unnamedInjectedExtensionMethod2(this);
+    test::_extension#5|_unnamedInjectedExtensionPrivateMethod2(this);
   }
 }
-extension NamedInjectedExtension1 on test::Class { // from org-dartlang-testcase:///patch_lib1.dart
-  method namedInjectedExtensionMethod1 = test::NamedInjectedExtension1|namedInjectedExtensionMethod1;
-  method tearoff namedInjectedExtensionMethod1 = test::NamedInjectedExtension1|get#namedInjectedExtensionMethod1;
-  method _namedInjectedExtensionPrivateMethod1 = test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1;
-  method tearoff _namedInjectedExtensionPrivateMethod1 = test::NamedInjectedExtension1|get#_namedInjectedExtensionPrivateMethod1;
-}
-extension /* unnamed */ _extension#1 on test::Class { // from org-dartlang-testcase:///patch_lib1.dart
-  method unnamedInjectedExtensionMethod1 = test::_extension#1|unnamedInjectedExtensionMethod1;
-  method tearoff unnamedInjectedExtensionMethod1 = test::_extension#1|get#unnamedInjectedExtensionMethod1;
-  method _unnamedInjectedExtensionPrivateMethod1 = test::_extension#1|_unnamedInjectedExtensionPrivateMethod1;
-  method tearoff _unnamedInjectedExtensionPrivateMethod1 = test::_extension#1|get#_unnamedInjectedExtensionPrivateMethod1;
-}
-extension NamedInjectedExtension2 on test::Class { // from org-dartlang-testcase:///patch_lib2.dart
-  method namedInjectedExtensionMethod2 = test::NamedInjectedExtension2|namedInjectedExtensionMethod2;
-  method tearoff namedInjectedExtensionMethod2 = test::NamedInjectedExtension2|get#namedInjectedExtensionMethod2;
-  method _namedInjectedExtensionPrivateMethod2 = test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2;
-  method tearoff _namedInjectedExtensionPrivateMethod2 = test::NamedInjectedExtension2|get#_namedInjectedExtensionPrivateMethod2;
-}
-extension /* unnamed */ _extension#3 on test::Class { // from org-dartlang-testcase:///patch_lib2.dart
-  method unnamedInjectedExtensionMethod2 = test::_extension#3|unnamedInjectedExtensionMethod2;
-  method tearoff unnamedInjectedExtensionMethod2 = test::_extension#3|get#unnamedInjectedExtensionMethod2;
-  method _unnamedInjectedExtensionPrivateMethod2 = test::_extension#3|_unnamedInjectedExtensionPrivateMethod2;
-  method tearoff _unnamedInjectedExtensionPrivateMethod2 = test::_extension#3|get#_unnamedInjectedExtensionPrivateMethod2;
-}
 extension Extension on test::Class {
   method namedExtensionMethod = test::Extension|namedExtensionMethod;
   method tearoff namedExtensionMethod = test::Extension|get#namedExtensionMethod;
   method _namedExtensionPrivateMethod = test::Extension|_namedExtensionPrivateMethod;
   method tearoff _namedExtensionPrivateMethod = test::Extension|get#_namedExtensionPrivateMethod;
 }
-extension /* unnamed */ _extension#5 on test::Class {
-  method unnamedExtensionMethod = test::_extension#5|unnamedExtensionMethod;
-  method tearoff unnamedExtensionMethod = test::_extension#5|get#unnamedExtensionMethod;
-  method _unnamedExtensionPrivateMethod = test::_extension#5|_unnamedExtensionPrivateMethod;
-  method tearoff _unnamedExtensionPrivateMethod = test::_extension#5|get#_unnamedExtensionPrivateMethod;
+extension NamedInjectedExtension1 on test::Class { // from org-dartlang-testcase:///patch_lib1.dart
+  method namedInjectedExtensionMethod1 = test::NamedInjectedExtension1|namedInjectedExtensionMethod1;
+  method tearoff namedInjectedExtensionMethod1 = test::NamedInjectedExtension1|get#namedInjectedExtensionMethod1;
+  method _namedInjectedExtensionPrivateMethod1 = test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1;
+  method tearoff _namedInjectedExtensionPrivateMethod1 = test::NamedInjectedExtension1|get#_namedInjectedExtensionPrivateMethod1;
+}
+extension NamedInjectedExtension2 on test::Class { // from org-dartlang-testcase:///patch_lib2.dart
+  method namedInjectedExtensionMethod2 = test::NamedInjectedExtension2|namedInjectedExtensionMethod2;
+  method tearoff namedInjectedExtensionMethod2 = test::NamedInjectedExtension2|get#namedInjectedExtensionMethod2;
+  method _namedInjectedExtensionPrivateMethod2 = test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2;
+  method tearoff _namedInjectedExtensionPrivateMethod2 = test::NamedInjectedExtension2|get#_namedInjectedExtensionPrivateMethod2;
+}
+extension /* unnamed */ _extension#3 on test::Class {
+  method unnamedExtensionMethod = test::_extension#3|unnamedExtensionMethod;
+  method tearoff unnamedExtensionMethod = test::_extension#3|get#unnamedExtensionMethod;
+  method _unnamedExtensionPrivateMethod = test::_extension#3|_unnamedExtensionPrivateMethod;
+  method tearoff _unnamedExtensionPrivateMethod = test::_extension#3|get#_unnamedExtensionPrivateMethod;
+}
+extension /* unnamed */ _extension#4 on test::Class { // from org-dartlang-testcase:///patch_lib1.dart
+  method unnamedInjectedExtensionMethod1 = test::_extension#4|unnamedInjectedExtensionMethod1;
+  method tearoff unnamedInjectedExtensionMethod1 = test::_extension#4|get#unnamedInjectedExtensionMethod1;
+  method _unnamedInjectedExtensionPrivateMethod1 = test::_extension#4|_unnamedInjectedExtensionPrivateMethod1;
+  method tearoff _unnamedInjectedExtensionPrivateMethod1 = test::_extension#4|get#_unnamedInjectedExtensionPrivateMethod1;
+}
+extension /* unnamed */ _extension#5 on test::Class { // from org-dartlang-testcase:///patch_lib2.dart
+  method unnamedInjectedExtensionMethod2 = test::_extension#5|unnamedInjectedExtensionMethod2;
+  method tearoff unnamedInjectedExtensionMethod2 = test::_extension#5|get#unnamedInjectedExtensionMethod2;
+  method _unnamedInjectedExtensionPrivateMethod2 = test::_extension#5|_unnamedInjectedExtensionPrivateMethod2;
+  method tearoff _unnamedInjectedExtensionPrivateMethod2 = test::_extension#5|get#_unnamedInjectedExtensionPrivateMethod2;
 }
 static method _method(test::Class c) → void {
   test::Extension|namedExtensionMethod(c);
   test::Extension|_namedExtensionPrivateMethod(c);
-  test::_extension#5|unnamedExtensionMethod(c);
-  test::_extension#5|_unnamedExtensionPrivateMethod(c);
+  test::_extension#3|unnamedExtensionMethod(c);
+  test::_extension#3|_unnamedExtensionPrivateMethod(c);
   test::NamedInjectedExtension1|namedInjectedExtensionMethod1(c);
   test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(c);
-  test::_extension#1|unnamedInjectedExtensionMethod1(c);
-  test::_extension#1|_unnamedInjectedExtensionPrivateMethod1(c);
+  test::_extension#4|unnamedInjectedExtensionMethod1(c);
+  test::_extension#4|_unnamedInjectedExtensionPrivateMethod1(c);
   test::NamedInjectedExtension2|namedInjectedExtensionMethod2(c);
   test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(c);
-  test::_extension#3|unnamedInjectedExtensionMethod2(c);
-  test::_extension#3|_unnamedInjectedExtensionPrivateMethod2(c);
+  test::_extension#5|unnamedInjectedExtensionMethod2(c);
+  test::_extension#5|_unnamedInjectedExtensionPrivateMethod2(c);
 }
 static extension-member method Extension|namedExtensionMethod(lowered final test::Class #this) → void {}
 static extension-member method Extension|get#namedExtensionMethod(lowered final test::Class #this) → () → void
@@ -243,25 +243,25 @@
 static extension-member method Extension|_namedExtensionPrivateMethod(lowered final test::Class #this) → void {}
 static extension-member method Extension|get#_namedExtensionPrivateMethod(lowered final test::Class #this) → () → void
   return () → void => test::Extension|_namedExtensionPrivateMethod(#this);
-static extension-member method _extension#5|unnamedExtensionMethod(lowered final test::Class #this) → void {}
-static extension-member method _extension#5|get#unnamedExtensionMethod(lowered final test::Class #this) → () → void
-  return () → void => test::_extension#5|unnamedExtensionMethod(#this);
-static extension-member method _extension#5|_unnamedExtensionPrivateMethod(lowered final test::Class #this) → void {}
-static extension-member method _extension#5|get#_unnamedExtensionPrivateMethod(lowered final test::Class #this) → () → void
-  return () → void => test::_extension#5|_unnamedExtensionPrivateMethod(#this);
+static extension-member method _extension#3|unnamedExtensionMethod(lowered final test::Class #this) → void {}
+static extension-member method _extension#3|get#unnamedExtensionMethod(lowered final test::Class #this) → () → void
+  return () → void => test::_extension#3|unnamedExtensionMethod(#this);
+static extension-member method _extension#3|_unnamedExtensionPrivateMethod(lowered final test::Class #this) → void {}
+static extension-member method _extension#3|get#_unnamedExtensionPrivateMethod(lowered final test::Class #this) → () → void
+  return () → void => test::_extension#3|_unnamedExtensionPrivateMethod(#this);
 static method /* from org-dartlang-testcase:///patch_lib1.dart */ _method1(test::Class c) → void {
   test::Extension|namedExtensionMethod(c);
   test::Extension|_namedExtensionPrivateMethod(c);
-  test::_extension#5|unnamedExtensionMethod(c);
-  test::_extension#5|_unnamedExtensionPrivateMethod(c);
+  test::_extension#3|unnamedExtensionMethod(c);
+  test::_extension#3|_unnamedExtensionPrivateMethod(c);
   test::NamedInjectedExtension1|namedInjectedExtensionMethod1(c);
   test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(c);
-  test::_extension#1|unnamedInjectedExtensionMethod1(c);
-  test::_extension#1|_unnamedInjectedExtensionPrivateMethod1(c);
+  test::_extension#4|unnamedInjectedExtensionMethod1(c);
+  test::_extension#4|_unnamedInjectedExtensionPrivateMethod1(c);
   test::NamedInjectedExtension2|namedInjectedExtensionMethod2(c);
   test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(c);
-  test::_extension#3|unnamedInjectedExtensionMethod2(c);
-  test::_extension#3|_unnamedInjectedExtensionPrivateMethod2(c);
+  test::_extension#5|unnamedInjectedExtensionMethod2(c);
+  test::_extension#5|_unnamedInjectedExtensionPrivateMethod2(c);
 }
 static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ NamedInjectedExtension1|namedInjectedExtensionMethod1(lowered final test::Class #this) → void {}
 static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ NamedInjectedExtension1|get#namedInjectedExtensionMethod1(lowered final test::Class #this) → () → void
@@ -269,25 +269,25 @@
 static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(lowered final test::Class #this) → void {}
 static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ NamedInjectedExtension1|get#_namedInjectedExtensionPrivateMethod1(lowered final test::Class #this) → () → void
   return () → void => test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(#this);
-static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#1|unnamedInjectedExtensionMethod1(lowered final test::Class #this) → void {}
-static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#1|get#unnamedInjectedExtensionMethod1(lowered final test::Class #this) → () → void
-  return () → void => test::_extension#1|unnamedInjectedExtensionMethod1(#this);
-static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#1|_unnamedInjectedExtensionPrivateMethod1(lowered final test::Class #this) → void {}
-static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#1|get#_unnamedInjectedExtensionPrivateMethod1(lowered final test::Class #this) → () → void
-  return () → void => test::_extension#1|_unnamedInjectedExtensionPrivateMethod1(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#4|unnamedInjectedExtensionMethod1(lowered final test::Class #this) → void {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#4|get#unnamedInjectedExtensionMethod1(lowered final test::Class #this) → () → void
+  return () → void => test::_extension#4|unnamedInjectedExtensionMethod1(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#4|_unnamedInjectedExtensionPrivateMethod1(lowered final test::Class #this) → void {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#4|get#_unnamedInjectedExtensionPrivateMethod1(lowered final test::Class #this) → () → void
+  return () → void => test::_extension#4|_unnamedInjectedExtensionPrivateMethod1(#this);
 static method /* from org-dartlang-testcase:///patch_lib2.dart */ _method2(test::Class c) → void {
   test::Extension|namedExtensionMethod(c);
   test::Extension|_namedExtensionPrivateMethod(c);
-  test::_extension#5|unnamedExtensionMethod(c);
-  test::_extension#5|_unnamedExtensionPrivateMethod(c);
+  test::_extension#3|unnamedExtensionMethod(c);
+  test::_extension#3|_unnamedExtensionPrivateMethod(c);
   test::NamedInjectedExtension1|namedInjectedExtensionMethod1(c);
   test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(c);
-  test::_extension#1|unnamedInjectedExtensionMethod1(c);
-  test::_extension#1|_unnamedInjectedExtensionPrivateMethod1(c);
+  test::_extension#4|unnamedInjectedExtensionMethod1(c);
+  test::_extension#4|_unnamedInjectedExtensionPrivateMethod1(c);
   test::NamedInjectedExtension2|namedInjectedExtensionMethod2(c);
   test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(c);
-  test::_extension#3|unnamedInjectedExtensionMethod2(c);
-  test::_extension#3|_unnamedInjectedExtensionPrivateMethod2(c);
+  test::_extension#5|unnamedInjectedExtensionMethod2(c);
+  test::_extension#5|_unnamedInjectedExtensionPrivateMethod2(c);
 }
 static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ NamedInjectedExtension2|namedInjectedExtensionMethod2(lowered final test::Class #this) → void {}
 static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ NamedInjectedExtension2|get#namedInjectedExtensionMethod2(lowered final test::Class #this) → () → void
@@ -295,12 +295,12 @@
 static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(lowered final test::Class #this) → void {}
 static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ NamedInjectedExtension2|get#_namedInjectedExtensionPrivateMethod2(lowered final test::Class #this) → () → void
   return () → void => test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(#this);
-static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#3|unnamedInjectedExtensionMethod2(lowered final test::Class #this) → void {}
-static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#3|get#unnamedInjectedExtensionMethod2(lowered final test::Class #this) → () → void
-  return () → void => test::_extension#3|unnamedInjectedExtensionMethod2(#this);
-static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#3|_unnamedInjectedExtensionPrivateMethod2(lowered final test::Class #this) → void {}
-static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#3|get#_unnamedInjectedExtensionPrivateMethod2(lowered final test::Class #this) → () → void
-  return () → void => test::_extension#3|_unnamedInjectedExtensionPrivateMethod2(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#5|unnamedInjectedExtensionMethod2(lowered final test::Class #this) → void {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#5|get#unnamedInjectedExtensionMethod2(lowered final test::Class #this) → () → void
+  return () → void => test::_extension#5|unnamedInjectedExtensionMethod2(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#5|_unnamedInjectedExtensionPrivateMethod2(lowered final test::Class #this) → void {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#5|get#_unnamedInjectedExtensionPrivateMethod2(lowered final test::Class #this) → () → void
+  return () → void => test::_extension#5|_unnamedInjectedExtensionPrivateMethod2(#this);
 
 constants  {
   #C1 = _in::_Patch {}
diff --git a/pkg/front_end/testcases/general/patch_extension_scope/main.dart.strong.outline.expect b/pkg/front_end/testcases/general/patch_extension_scope/main.dart.strong.outline.expect
index 22bb92a..c62940e 100644
--- a/pkg/front_end/testcases/general/patch_extension_scope/main.dart.strong.outline.expect
+++ b/pkg/front_end/testcases/general/patch_extension_scope/main.dart.strong.outline.expect
@@ -44,41 +44,41 @@
   method /* from org-dartlang-testcase:///patch_lib2.dart */ _method2() → void
     ;
 }
+extension Extension on test::Class {
+  method namedExtensionMethod = test::Extension|namedExtensionMethod;
+  method tearoff namedExtensionMethod = test::Extension|get#namedExtensionMethod;
+  method _namedExtensionPrivateMethod = test::Extension|_namedExtensionPrivateMethod;
+  method tearoff _namedExtensionPrivateMethod = test::Extension|get#_namedExtensionPrivateMethod;
+}
 extension NamedInjectedExtension1 on test::Class { // from org-dartlang-testcase:///patch_lib1.dart
   method namedInjectedExtensionMethod1 = test::NamedInjectedExtension1|namedInjectedExtensionMethod1;
   method tearoff namedInjectedExtensionMethod1 = test::NamedInjectedExtension1|get#namedInjectedExtensionMethod1;
   method _namedInjectedExtensionPrivateMethod1 = test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1;
   method tearoff _namedInjectedExtensionPrivateMethod1 = test::NamedInjectedExtension1|get#_namedInjectedExtensionPrivateMethod1;
 }
-extension /* unnamed */ _extension#1 on test::Class { // from org-dartlang-testcase:///patch_lib1.dart
-  method unnamedInjectedExtensionMethod1 = test::_extension#1|unnamedInjectedExtensionMethod1;
-  method tearoff unnamedInjectedExtensionMethod1 = test::_extension#1|get#unnamedInjectedExtensionMethod1;
-  method _unnamedInjectedExtensionPrivateMethod1 = test::_extension#1|_unnamedInjectedExtensionPrivateMethod1;
-  method tearoff _unnamedInjectedExtensionPrivateMethod1 = test::_extension#1|get#_unnamedInjectedExtensionPrivateMethod1;
-}
 extension NamedInjectedExtension2 on test::Class { // from org-dartlang-testcase:///patch_lib2.dart
   method namedInjectedExtensionMethod2 = test::NamedInjectedExtension2|namedInjectedExtensionMethod2;
   method tearoff namedInjectedExtensionMethod2 = test::NamedInjectedExtension2|get#namedInjectedExtensionMethod2;
   method _namedInjectedExtensionPrivateMethod2 = test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2;
   method tearoff _namedInjectedExtensionPrivateMethod2 = test::NamedInjectedExtension2|get#_namedInjectedExtensionPrivateMethod2;
 }
-extension /* unnamed */ _extension#3 on test::Class { // from org-dartlang-testcase:///patch_lib2.dart
-  method unnamedInjectedExtensionMethod2 = test::_extension#3|unnamedInjectedExtensionMethod2;
-  method tearoff unnamedInjectedExtensionMethod2 = test::_extension#3|get#unnamedInjectedExtensionMethod2;
-  method _unnamedInjectedExtensionPrivateMethod2 = test::_extension#3|_unnamedInjectedExtensionPrivateMethod2;
-  method tearoff _unnamedInjectedExtensionPrivateMethod2 = test::_extension#3|get#_unnamedInjectedExtensionPrivateMethod2;
+extension /* unnamed */ _extension#3 on test::Class {
+  method unnamedExtensionMethod = test::_extension#3|unnamedExtensionMethod;
+  method tearoff unnamedExtensionMethod = test::_extension#3|get#unnamedExtensionMethod;
+  method _unnamedExtensionPrivateMethod = test::_extension#3|_unnamedExtensionPrivateMethod;
+  method tearoff _unnamedExtensionPrivateMethod = test::_extension#3|get#_unnamedExtensionPrivateMethod;
 }
-extension Extension on test::Class {
-  method namedExtensionMethod = test::Extension|namedExtensionMethod;
-  method tearoff namedExtensionMethod = test::Extension|get#namedExtensionMethod;
-  method _namedExtensionPrivateMethod = test::Extension|_namedExtensionPrivateMethod;
-  method tearoff _namedExtensionPrivateMethod = test::Extension|get#_namedExtensionPrivateMethod;
+extension /* unnamed */ _extension#4 on test::Class { // from org-dartlang-testcase:///patch_lib1.dart
+  method unnamedInjectedExtensionMethod1 = test::_extension#4|unnamedInjectedExtensionMethod1;
+  method tearoff unnamedInjectedExtensionMethod1 = test::_extension#4|get#unnamedInjectedExtensionMethod1;
+  method _unnamedInjectedExtensionPrivateMethod1 = test::_extension#4|_unnamedInjectedExtensionPrivateMethod1;
+  method tearoff _unnamedInjectedExtensionPrivateMethod1 = test::_extension#4|get#_unnamedInjectedExtensionPrivateMethod1;
 }
-extension /* unnamed */ _extension#5 on test::Class {
-  method unnamedExtensionMethod = test::_extension#5|unnamedExtensionMethod;
-  method tearoff unnamedExtensionMethod = test::_extension#5|get#unnamedExtensionMethod;
-  method _unnamedExtensionPrivateMethod = test::_extension#5|_unnamedExtensionPrivateMethod;
-  method tearoff _unnamedExtensionPrivateMethod = test::_extension#5|get#_unnamedExtensionPrivateMethod;
+extension /* unnamed */ _extension#5 on test::Class { // from org-dartlang-testcase:///patch_lib2.dart
+  method unnamedInjectedExtensionMethod2 = test::_extension#5|unnamedInjectedExtensionMethod2;
+  method tearoff unnamedInjectedExtensionMethod2 = test::_extension#5|get#unnamedInjectedExtensionMethod2;
+  method _unnamedInjectedExtensionPrivateMethod2 = test::_extension#5|_unnamedInjectedExtensionPrivateMethod2;
+  method tearoff _unnamedInjectedExtensionPrivateMethod2 = test::_extension#5|get#_unnamedInjectedExtensionPrivateMethod2;
 }
 static method _method(test::Class c) → void
   ;
@@ -90,14 +90,14 @@
   ;
 static extension-member method Extension|get#_namedExtensionPrivateMethod(lowered final test::Class #this) → () → void
   return () → void => test::Extension|_namedExtensionPrivateMethod(#this);
-static extension-member method _extension#5|unnamedExtensionMethod(lowered final test::Class #this) → void
+static extension-member method _extension#3|unnamedExtensionMethod(lowered final test::Class #this) → void
   ;
-static extension-member method _extension#5|get#unnamedExtensionMethod(lowered final test::Class #this) → () → void
-  return () → void => test::_extension#5|unnamedExtensionMethod(#this);
-static extension-member method _extension#5|_unnamedExtensionPrivateMethod(lowered final test::Class #this) → void
+static extension-member method _extension#3|get#unnamedExtensionMethod(lowered final test::Class #this) → () → void
+  return () → void => test::_extension#3|unnamedExtensionMethod(#this);
+static extension-member method _extension#3|_unnamedExtensionPrivateMethod(lowered final test::Class #this) → void
   ;
-static extension-member method _extension#5|get#_unnamedExtensionPrivateMethod(lowered final test::Class #this) → () → void
-  return () → void => test::_extension#5|_unnamedExtensionPrivateMethod(#this);
+static extension-member method _extension#3|get#_unnamedExtensionPrivateMethod(lowered final test::Class #this) → () → void
+  return () → void => test::_extension#3|_unnamedExtensionPrivateMethod(#this);
 static method /* from org-dartlang-testcase:///patch_lib1.dart */ _method1(test::Class c) → void
   ;
 static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ NamedInjectedExtension1|namedInjectedExtensionMethod1(lowered final test::Class #this) → void
@@ -108,14 +108,14 @@
   ;
 static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ NamedInjectedExtension1|get#_namedInjectedExtensionPrivateMethod1(lowered final test::Class #this) → () → void
   return () → void => test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(#this);
-static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#1|unnamedInjectedExtensionMethod1(lowered final test::Class #this) → void
+static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#4|unnamedInjectedExtensionMethod1(lowered final test::Class #this) → void
   ;
-static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#1|get#unnamedInjectedExtensionMethod1(lowered final test::Class #this) → () → void
-  return () → void => test::_extension#1|unnamedInjectedExtensionMethod1(#this);
-static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#1|_unnamedInjectedExtensionPrivateMethod1(lowered final test::Class #this) → void
+static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#4|get#unnamedInjectedExtensionMethod1(lowered final test::Class #this) → () → void
+  return () → void => test::_extension#4|unnamedInjectedExtensionMethod1(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#4|_unnamedInjectedExtensionPrivateMethod1(lowered final test::Class #this) → void
   ;
-static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#1|get#_unnamedInjectedExtensionPrivateMethod1(lowered final test::Class #this) → () → void
-  return () → void => test::_extension#1|_unnamedInjectedExtensionPrivateMethod1(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#4|get#_unnamedInjectedExtensionPrivateMethod1(lowered final test::Class #this) → () → void
+  return () → void => test::_extension#4|_unnamedInjectedExtensionPrivateMethod1(#this);
 static method /* from org-dartlang-testcase:///patch_lib2.dart */ _method2(test::Class c) → void
   ;
 static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ NamedInjectedExtension2|namedInjectedExtensionMethod2(lowered final test::Class #this) → void
@@ -126,14 +126,14 @@
   ;
 static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ NamedInjectedExtension2|get#_namedInjectedExtensionPrivateMethod2(lowered final test::Class #this) → () → void
   return () → void => test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(#this);
-static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#3|unnamedInjectedExtensionMethod2(lowered final test::Class #this) → void
+static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#5|unnamedInjectedExtensionMethod2(lowered final test::Class #this) → void
   ;
-static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#3|get#unnamedInjectedExtensionMethod2(lowered final test::Class #this) → () → void
-  return () → void => test::_extension#3|unnamedInjectedExtensionMethod2(#this);
-static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#3|_unnamedInjectedExtensionPrivateMethod2(lowered final test::Class #this) → void
+static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#5|get#unnamedInjectedExtensionMethod2(lowered final test::Class #this) → () → void
+  return () → void => test::_extension#5|unnamedInjectedExtensionMethod2(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#5|_unnamedInjectedExtensionPrivateMethod2(lowered final test::Class #this) → void
   ;
-static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#3|get#_unnamedInjectedExtensionPrivateMethod2(lowered final test::Class #this) → () → void
-  return () → void => test::_extension#3|_unnamedInjectedExtensionPrivateMethod2(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#5|get#_unnamedInjectedExtensionPrivateMethod2(lowered final test::Class #this) → () → void
+  return () → void => test::_extension#5|_unnamedInjectedExtensionPrivateMethod2(#this);
 
 
 Extra constant evaluation status:
diff --git a/pkg/front_end/testcases/general/patch_extension_scope/main.dart.strong.transformed.expect b/pkg/front_end/testcases/general/patch_extension_scope/main.dart.strong.transformed.expect
index 2d098ec..a8dc68c 100644
--- a/pkg/front_end/testcases/general/patch_extension_scope/main.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/patch_extension_scope/main.dart.strong.transformed.expect
@@ -147,95 +147,95 @@
   method _method() → void {
     test::Extension|namedExtensionMethod(this);
     test::Extension|_namedExtensionPrivateMethod(this);
-    test::_extension#5|unnamedExtensionMethod(this);
-    test::_extension#5|_unnamedExtensionPrivateMethod(this);
+    test::_extension#3|unnamedExtensionMethod(this);
+    test::_extension#3|_unnamedExtensionPrivateMethod(this);
     test::NamedInjectedExtension1|namedInjectedExtensionMethod1(this);
     test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(this);
-    test::_extension#1|unnamedInjectedExtensionMethod1(this);
-    test::_extension#1|_unnamedInjectedExtensionPrivateMethod1(this);
+    test::_extension#4|unnamedInjectedExtensionMethod1(this);
+    test::_extension#4|_unnamedInjectedExtensionPrivateMethod1(this);
     test::NamedInjectedExtension2|namedInjectedExtensionMethod2(this);
     test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(this);
-    test::_extension#3|unnamedInjectedExtensionMethod2(this);
-    test::_extension#3|_unnamedInjectedExtensionPrivateMethod2(this);
+    test::_extension#5|unnamedInjectedExtensionMethod2(this);
+    test::_extension#5|_unnamedInjectedExtensionPrivateMethod2(this);
   }
   method /* from org-dartlang-testcase:///patch_lib1.dart */ _method1() → void {
     test::Extension|namedExtensionMethod(this);
     test::Extension|_namedExtensionPrivateMethod(this);
-    test::_extension#5|unnamedExtensionMethod(this);
-    test::_extension#5|_unnamedExtensionPrivateMethod(this);
+    test::_extension#3|unnamedExtensionMethod(this);
+    test::_extension#3|_unnamedExtensionPrivateMethod(this);
     test::NamedInjectedExtension1|namedInjectedExtensionMethod1(this);
     test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(this);
-    test::_extension#1|unnamedInjectedExtensionMethod1(this);
-    test::_extension#1|_unnamedInjectedExtensionPrivateMethod1(this);
+    test::_extension#4|unnamedInjectedExtensionMethod1(this);
+    test::_extension#4|_unnamedInjectedExtensionPrivateMethod1(this);
     test::NamedInjectedExtension2|namedInjectedExtensionMethod2(this);
     test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(this);
-    test::_extension#3|unnamedInjectedExtensionMethod2(this);
-    test::_extension#3|_unnamedInjectedExtensionPrivateMethod2(this);
+    test::_extension#5|unnamedInjectedExtensionMethod2(this);
+    test::_extension#5|_unnamedInjectedExtensionPrivateMethod2(this);
   }
   method /* from org-dartlang-testcase:///patch_lib2.dart */ _method2() → void {
     test::Extension|namedExtensionMethod(this);
     test::Extension|_namedExtensionPrivateMethod(this);
-    test::_extension#5|unnamedExtensionMethod(this);
-    test::_extension#5|_unnamedExtensionPrivateMethod(this);
+    test::_extension#3|unnamedExtensionMethod(this);
+    test::_extension#3|_unnamedExtensionPrivateMethod(this);
     test::NamedInjectedExtension1|namedInjectedExtensionMethod1(this);
     test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(this);
-    test::_extension#1|unnamedInjectedExtensionMethod1(this);
-    test::_extension#1|_unnamedInjectedExtensionPrivateMethod1(this);
+    test::_extension#4|unnamedInjectedExtensionMethod1(this);
+    test::_extension#4|_unnamedInjectedExtensionPrivateMethod1(this);
     test::NamedInjectedExtension2|namedInjectedExtensionMethod2(this);
     test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(this);
-    test::_extension#3|unnamedInjectedExtensionMethod2(this);
-    test::_extension#3|_unnamedInjectedExtensionPrivateMethod2(this);
+    test::_extension#5|unnamedInjectedExtensionMethod2(this);
+    test::_extension#5|_unnamedInjectedExtensionPrivateMethod2(this);
   }
 }
-extension NamedInjectedExtension1 on test::Class { // from org-dartlang-testcase:///patch_lib1.dart
-  method namedInjectedExtensionMethod1 = test::NamedInjectedExtension1|namedInjectedExtensionMethod1;
-  method tearoff namedInjectedExtensionMethod1 = test::NamedInjectedExtension1|get#namedInjectedExtensionMethod1;
-  method _namedInjectedExtensionPrivateMethod1 = test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1;
-  method tearoff _namedInjectedExtensionPrivateMethod1 = test::NamedInjectedExtension1|get#_namedInjectedExtensionPrivateMethod1;
-}
-extension /* unnamed */ _extension#1 on test::Class { // from org-dartlang-testcase:///patch_lib1.dart
-  method unnamedInjectedExtensionMethod1 = test::_extension#1|unnamedInjectedExtensionMethod1;
-  method tearoff unnamedInjectedExtensionMethod1 = test::_extension#1|get#unnamedInjectedExtensionMethod1;
-  method _unnamedInjectedExtensionPrivateMethod1 = test::_extension#1|_unnamedInjectedExtensionPrivateMethod1;
-  method tearoff _unnamedInjectedExtensionPrivateMethod1 = test::_extension#1|get#_unnamedInjectedExtensionPrivateMethod1;
-}
-extension NamedInjectedExtension2 on test::Class { // from org-dartlang-testcase:///patch_lib2.dart
-  method namedInjectedExtensionMethod2 = test::NamedInjectedExtension2|namedInjectedExtensionMethod2;
-  method tearoff namedInjectedExtensionMethod2 = test::NamedInjectedExtension2|get#namedInjectedExtensionMethod2;
-  method _namedInjectedExtensionPrivateMethod2 = test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2;
-  method tearoff _namedInjectedExtensionPrivateMethod2 = test::NamedInjectedExtension2|get#_namedInjectedExtensionPrivateMethod2;
-}
-extension /* unnamed */ _extension#3 on test::Class { // from org-dartlang-testcase:///patch_lib2.dart
-  method unnamedInjectedExtensionMethod2 = test::_extension#3|unnamedInjectedExtensionMethod2;
-  method tearoff unnamedInjectedExtensionMethod2 = test::_extension#3|get#unnamedInjectedExtensionMethod2;
-  method _unnamedInjectedExtensionPrivateMethod2 = test::_extension#3|_unnamedInjectedExtensionPrivateMethod2;
-  method tearoff _unnamedInjectedExtensionPrivateMethod2 = test::_extension#3|get#_unnamedInjectedExtensionPrivateMethod2;
-}
 extension Extension on test::Class {
   method namedExtensionMethod = test::Extension|namedExtensionMethod;
   method tearoff namedExtensionMethod = test::Extension|get#namedExtensionMethod;
   method _namedExtensionPrivateMethod = test::Extension|_namedExtensionPrivateMethod;
   method tearoff _namedExtensionPrivateMethod = test::Extension|get#_namedExtensionPrivateMethod;
 }
-extension /* unnamed */ _extension#5 on test::Class {
-  method unnamedExtensionMethod = test::_extension#5|unnamedExtensionMethod;
-  method tearoff unnamedExtensionMethod = test::_extension#5|get#unnamedExtensionMethod;
-  method _unnamedExtensionPrivateMethod = test::_extension#5|_unnamedExtensionPrivateMethod;
-  method tearoff _unnamedExtensionPrivateMethod = test::_extension#5|get#_unnamedExtensionPrivateMethod;
+extension NamedInjectedExtension1 on test::Class { // from org-dartlang-testcase:///patch_lib1.dart
+  method namedInjectedExtensionMethod1 = test::NamedInjectedExtension1|namedInjectedExtensionMethod1;
+  method tearoff namedInjectedExtensionMethod1 = test::NamedInjectedExtension1|get#namedInjectedExtensionMethod1;
+  method _namedInjectedExtensionPrivateMethod1 = test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1;
+  method tearoff _namedInjectedExtensionPrivateMethod1 = test::NamedInjectedExtension1|get#_namedInjectedExtensionPrivateMethod1;
+}
+extension NamedInjectedExtension2 on test::Class { // from org-dartlang-testcase:///patch_lib2.dart
+  method namedInjectedExtensionMethod2 = test::NamedInjectedExtension2|namedInjectedExtensionMethod2;
+  method tearoff namedInjectedExtensionMethod2 = test::NamedInjectedExtension2|get#namedInjectedExtensionMethod2;
+  method _namedInjectedExtensionPrivateMethod2 = test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2;
+  method tearoff _namedInjectedExtensionPrivateMethod2 = test::NamedInjectedExtension2|get#_namedInjectedExtensionPrivateMethod2;
+}
+extension /* unnamed */ _extension#3 on test::Class {
+  method unnamedExtensionMethod = test::_extension#3|unnamedExtensionMethod;
+  method tearoff unnamedExtensionMethod = test::_extension#3|get#unnamedExtensionMethod;
+  method _unnamedExtensionPrivateMethod = test::_extension#3|_unnamedExtensionPrivateMethod;
+  method tearoff _unnamedExtensionPrivateMethod = test::_extension#3|get#_unnamedExtensionPrivateMethod;
+}
+extension /* unnamed */ _extension#4 on test::Class { // from org-dartlang-testcase:///patch_lib1.dart
+  method unnamedInjectedExtensionMethod1 = test::_extension#4|unnamedInjectedExtensionMethod1;
+  method tearoff unnamedInjectedExtensionMethod1 = test::_extension#4|get#unnamedInjectedExtensionMethod1;
+  method _unnamedInjectedExtensionPrivateMethod1 = test::_extension#4|_unnamedInjectedExtensionPrivateMethod1;
+  method tearoff _unnamedInjectedExtensionPrivateMethod1 = test::_extension#4|get#_unnamedInjectedExtensionPrivateMethod1;
+}
+extension /* unnamed */ _extension#5 on test::Class { // from org-dartlang-testcase:///patch_lib2.dart
+  method unnamedInjectedExtensionMethod2 = test::_extension#5|unnamedInjectedExtensionMethod2;
+  method tearoff unnamedInjectedExtensionMethod2 = test::_extension#5|get#unnamedInjectedExtensionMethod2;
+  method _unnamedInjectedExtensionPrivateMethod2 = test::_extension#5|_unnamedInjectedExtensionPrivateMethod2;
+  method tearoff _unnamedInjectedExtensionPrivateMethod2 = test::_extension#5|get#_unnamedInjectedExtensionPrivateMethod2;
 }
 static method _method(test::Class c) → void {
   test::Extension|namedExtensionMethod(c);
   test::Extension|_namedExtensionPrivateMethod(c);
-  test::_extension#5|unnamedExtensionMethod(c);
-  test::_extension#5|_unnamedExtensionPrivateMethod(c);
+  test::_extension#3|unnamedExtensionMethod(c);
+  test::_extension#3|_unnamedExtensionPrivateMethod(c);
   test::NamedInjectedExtension1|namedInjectedExtensionMethod1(c);
   test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(c);
-  test::_extension#1|unnamedInjectedExtensionMethod1(c);
-  test::_extension#1|_unnamedInjectedExtensionPrivateMethod1(c);
+  test::_extension#4|unnamedInjectedExtensionMethod1(c);
+  test::_extension#4|_unnamedInjectedExtensionPrivateMethod1(c);
   test::NamedInjectedExtension2|namedInjectedExtensionMethod2(c);
   test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(c);
-  test::_extension#3|unnamedInjectedExtensionMethod2(c);
-  test::_extension#3|_unnamedInjectedExtensionPrivateMethod2(c);
+  test::_extension#5|unnamedInjectedExtensionMethod2(c);
+  test::_extension#5|_unnamedInjectedExtensionPrivateMethod2(c);
 }
 static extension-member method Extension|namedExtensionMethod(lowered final test::Class #this) → void {}
 static extension-member method Extension|get#namedExtensionMethod(lowered final test::Class #this) → () → void
@@ -243,25 +243,25 @@
 static extension-member method Extension|_namedExtensionPrivateMethod(lowered final test::Class #this) → void {}
 static extension-member method Extension|get#_namedExtensionPrivateMethod(lowered final test::Class #this) → () → void
   return () → void => test::Extension|_namedExtensionPrivateMethod(#this);
-static extension-member method _extension#5|unnamedExtensionMethod(lowered final test::Class #this) → void {}
-static extension-member method _extension#5|get#unnamedExtensionMethod(lowered final test::Class #this) → () → void
-  return () → void => test::_extension#5|unnamedExtensionMethod(#this);
-static extension-member method _extension#5|_unnamedExtensionPrivateMethod(lowered final test::Class #this) → void {}
-static extension-member method _extension#5|get#_unnamedExtensionPrivateMethod(lowered final test::Class #this) → () → void
-  return () → void => test::_extension#5|_unnamedExtensionPrivateMethod(#this);
+static extension-member method _extension#3|unnamedExtensionMethod(lowered final test::Class #this) → void {}
+static extension-member method _extension#3|get#unnamedExtensionMethod(lowered final test::Class #this) → () → void
+  return () → void => test::_extension#3|unnamedExtensionMethod(#this);
+static extension-member method _extension#3|_unnamedExtensionPrivateMethod(lowered final test::Class #this) → void {}
+static extension-member method _extension#3|get#_unnamedExtensionPrivateMethod(lowered final test::Class #this) → () → void
+  return () → void => test::_extension#3|_unnamedExtensionPrivateMethod(#this);
 static method /* from org-dartlang-testcase:///patch_lib1.dart */ _method1(test::Class c) → void {
   test::Extension|namedExtensionMethod(c);
   test::Extension|_namedExtensionPrivateMethod(c);
-  test::_extension#5|unnamedExtensionMethod(c);
-  test::_extension#5|_unnamedExtensionPrivateMethod(c);
+  test::_extension#3|unnamedExtensionMethod(c);
+  test::_extension#3|_unnamedExtensionPrivateMethod(c);
   test::NamedInjectedExtension1|namedInjectedExtensionMethod1(c);
   test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(c);
-  test::_extension#1|unnamedInjectedExtensionMethod1(c);
-  test::_extension#1|_unnamedInjectedExtensionPrivateMethod1(c);
+  test::_extension#4|unnamedInjectedExtensionMethod1(c);
+  test::_extension#4|_unnamedInjectedExtensionPrivateMethod1(c);
   test::NamedInjectedExtension2|namedInjectedExtensionMethod2(c);
   test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(c);
-  test::_extension#3|unnamedInjectedExtensionMethod2(c);
-  test::_extension#3|_unnamedInjectedExtensionPrivateMethod2(c);
+  test::_extension#5|unnamedInjectedExtensionMethod2(c);
+  test::_extension#5|_unnamedInjectedExtensionPrivateMethod2(c);
 }
 static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ NamedInjectedExtension1|namedInjectedExtensionMethod1(lowered final test::Class #this) → void {}
 static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ NamedInjectedExtension1|get#namedInjectedExtensionMethod1(lowered final test::Class #this) → () → void
@@ -269,25 +269,25 @@
 static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(lowered final test::Class #this) → void {}
 static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ NamedInjectedExtension1|get#_namedInjectedExtensionPrivateMethod1(lowered final test::Class #this) → () → void
   return () → void => test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(#this);
-static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#1|unnamedInjectedExtensionMethod1(lowered final test::Class #this) → void {}
-static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#1|get#unnamedInjectedExtensionMethod1(lowered final test::Class #this) → () → void
-  return () → void => test::_extension#1|unnamedInjectedExtensionMethod1(#this);
-static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#1|_unnamedInjectedExtensionPrivateMethod1(lowered final test::Class #this) → void {}
-static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#1|get#_unnamedInjectedExtensionPrivateMethod1(lowered final test::Class #this) → () → void
-  return () → void => test::_extension#1|_unnamedInjectedExtensionPrivateMethod1(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#4|unnamedInjectedExtensionMethod1(lowered final test::Class #this) → void {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#4|get#unnamedInjectedExtensionMethod1(lowered final test::Class #this) → () → void
+  return () → void => test::_extension#4|unnamedInjectedExtensionMethod1(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#4|_unnamedInjectedExtensionPrivateMethod1(lowered final test::Class #this) → void {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib1.dart */ _extension#4|get#_unnamedInjectedExtensionPrivateMethod1(lowered final test::Class #this) → () → void
+  return () → void => test::_extension#4|_unnamedInjectedExtensionPrivateMethod1(#this);
 static method /* from org-dartlang-testcase:///patch_lib2.dart */ _method2(test::Class c) → void {
   test::Extension|namedExtensionMethod(c);
   test::Extension|_namedExtensionPrivateMethod(c);
-  test::_extension#5|unnamedExtensionMethod(c);
-  test::_extension#5|_unnamedExtensionPrivateMethod(c);
+  test::_extension#3|unnamedExtensionMethod(c);
+  test::_extension#3|_unnamedExtensionPrivateMethod(c);
   test::NamedInjectedExtension1|namedInjectedExtensionMethod1(c);
   test::NamedInjectedExtension1|_namedInjectedExtensionPrivateMethod1(c);
-  test::_extension#1|unnamedInjectedExtensionMethod1(c);
-  test::_extension#1|_unnamedInjectedExtensionPrivateMethod1(c);
+  test::_extension#4|unnamedInjectedExtensionMethod1(c);
+  test::_extension#4|_unnamedInjectedExtensionPrivateMethod1(c);
   test::NamedInjectedExtension2|namedInjectedExtensionMethod2(c);
   test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(c);
-  test::_extension#3|unnamedInjectedExtensionMethod2(c);
-  test::_extension#3|_unnamedInjectedExtensionPrivateMethod2(c);
+  test::_extension#5|unnamedInjectedExtensionMethod2(c);
+  test::_extension#5|_unnamedInjectedExtensionPrivateMethod2(c);
 }
 static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ NamedInjectedExtension2|namedInjectedExtensionMethod2(lowered final test::Class #this) → void {}
 static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ NamedInjectedExtension2|get#namedInjectedExtensionMethod2(lowered final test::Class #this) → () → void
@@ -295,12 +295,12 @@
 static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(lowered final test::Class #this) → void {}
 static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ NamedInjectedExtension2|get#_namedInjectedExtensionPrivateMethod2(lowered final test::Class #this) → () → void
   return () → void => test::NamedInjectedExtension2|_namedInjectedExtensionPrivateMethod2(#this);
-static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#3|unnamedInjectedExtensionMethod2(lowered final test::Class #this) → void {}
-static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#3|get#unnamedInjectedExtensionMethod2(lowered final test::Class #this) → () → void
-  return () → void => test::_extension#3|unnamedInjectedExtensionMethod2(#this);
-static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#3|_unnamedInjectedExtensionPrivateMethod2(lowered final test::Class #this) → void {}
-static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#3|get#_unnamedInjectedExtensionPrivateMethod2(lowered final test::Class #this) → () → void
-  return () → void => test::_extension#3|_unnamedInjectedExtensionPrivateMethod2(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#5|unnamedInjectedExtensionMethod2(lowered final test::Class #this) → void {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#5|get#unnamedInjectedExtensionMethod2(lowered final test::Class #this) → () → void
+  return () → void => test::_extension#5|unnamedInjectedExtensionMethod2(#this);
+static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#5|_unnamedInjectedExtensionPrivateMethod2(lowered final test::Class #this) → void {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib2.dart */ _extension#5|get#_unnamedInjectedExtensionPrivateMethod2(lowered final test::Class #this) → () → void
+  return () → void => test::_extension#5|_unnamedInjectedExtensionPrivateMethod2(#this);
 
 constants  {
   #C1 = _in::_Patch {}
diff --git a/pkg/front_end/testcases/general/patch_prefix_access/libraries.json b/pkg/front_end/testcases/general/patch_prefix_access/libraries.json
new file mode 100644
index 0000000..79373ad
--- /dev/null
+++ b/pkg/front_end/testcases/general/patch_prefix_access/libraries.json
@@ -0,0 +1,13 @@
+{
+  "vm": {
+    "comment:0": "This adds to the default libraries found in the platform.",
+    "libraries": {
+      "test": {
+        "patches": [
+          "patch_lib.dart"
+        ],
+        "uri": "origin_lib.dart"
+      }
+    }
+  }
+}
diff --git a/pkg/front_end/testcases/general/patch_prefix_access/main.dart b/pkg/front_end/testcases/general/patch_prefix_access/main.dart
new file mode 100644
index 0000000..f6ad47f
--- /dev/null
+++ b/pkg/front_end/testcases/general/patch_prefix_access/main.dart
@@ -0,0 +1,9 @@
+// Copyright (c) 2025, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:test';
+
+main() {
+  Class().method();
+}
diff --git a/pkg/front_end/testcases/general/patch_prefix_access/main.dart.strong.expect b/pkg/front_end/testcases/general/patch_prefix_access/main.dart.strong.expect
new file mode 100644
index 0000000..9f93060
--- /dev/null
+++ b/pkg/front_end/testcases/general/patch_prefix_access/main.dart.strong.expect
@@ -0,0 +1,52 @@
+library;
+import self as self;
+import "dart:test" as test;
+import "dart:core" as core;
+
+import "dart:test";
+
+static method main() → dynamic {
+  new test::Class::•().{test::Class::method}(){() → core::int};
+}
+
+library;
+import self as test;
+import "dart:_internal" as _in;
+import "dart:core" as core;
+
+import "dart:_internal";
+import "org-dartlang-testcase:///main_lib.dart" as prefix;
+
+@/* from org-dartlang-testcase:///patch_lib.dart */ #C1
+class Class extends core::Object {
+  field core::int _field = #C2 /* from org-dartlang-testcase:///patch_lib.dart */;
+  synthetic constructor •() → test::Class
+    : super core::Object::•()
+    ;
+  @#C1
+  method /* from org-dartlang-testcase:///patch_lib.dart */ method() → core::int
+    return #C2;
+}
+@#C1
+extension Extension on core::int {
+  method method = test::Extension|method;
+  method tearoff method = test::Extension|get#method;
+  static field _field = test::Extension|_field;
+}
+static field core::int Extension|_field = #C2 /* from org-dartlang-testcase:///patch_lib.dart */;
+@#C1
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|method(lowered final core::int #this) → core::int
+  return #C2;
+static extension-member method Extension|get#method(lowered final core::int #this) → () → core::int
+  return () → core::int => test::Extension|method(#this);
+
+library;
+import self as self2;
+import "dart:core" as core;
+
+static const field core::int value = #C2;
+
+constants  {
+  #C1 = _in::_Patch {}
+  #C2 = 5
+}
diff --git a/pkg/front_end/testcases/general/patch_prefix_access/main.dart.strong.modular.expect b/pkg/front_end/testcases/general/patch_prefix_access/main.dart.strong.modular.expect
new file mode 100644
index 0000000..9f93060
--- /dev/null
+++ b/pkg/front_end/testcases/general/patch_prefix_access/main.dart.strong.modular.expect
@@ -0,0 +1,52 @@
+library;
+import self as self;
+import "dart:test" as test;
+import "dart:core" as core;
+
+import "dart:test";
+
+static method main() → dynamic {
+  new test::Class::•().{test::Class::method}(){() → core::int};
+}
+
+library;
+import self as test;
+import "dart:_internal" as _in;
+import "dart:core" as core;
+
+import "dart:_internal";
+import "org-dartlang-testcase:///main_lib.dart" as prefix;
+
+@/* from org-dartlang-testcase:///patch_lib.dart */ #C1
+class Class extends core::Object {
+  field core::int _field = #C2 /* from org-dartlang-testcase:///patch_lib.dart */;
+  synthetic constructor •() → test::Class
+    : super core::Object::•()
+    ;
+  @#C1
+  method /* from org-dartlang-testcase:///patch_lib.dart */ method() → core::int
+    return #C2;
+}
+@#C1
+extension Extension on core::int {
+  method method = test::Extension|method;
+  method tearoff method = test::Extension|get#method;
+  static field _field = test::Extension|_field;
+}
+static field core::int Extension|_field = #C2 /* from org-dartlang-testcase:///patch_lib.dart */;
+@#C1
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|method(lowered final core::int #this) → core::int
+  return #C2;
+static extension-member method Extension|get#method(lowered final core::int #this) → () → core::int
+  return () → core::int => test::Extension|method(#this);
+
+library;
+import self as self2;
+import "dart:core" as core;
+
+static const field core::int value = #C2;
+
+constants  {
+  #C1 = _in::_Patch {}
+  #C2 = 5
+}
diff --git a/pkg/front_end/testcases/general/patch_prefix_access/main.dart.strong.outline.expect b/pkg/front_end/testcases/general/patch_prefix_access/main.dart.strong.outline.expect
new file mode 100644
index 0000000..86f00a5
--- /dev/null
+++ b/pkg/front_end/testcases/general/patch_prefix_access/main.dart.strong.outline.expect
@@ -0,0 +1,49 @@
+library;
+import self as self;
+
+import "dart:test";
+
+static method main() → dynamic
+  ;
+
+library;
+import self as self2;
+import "dart:_internal" as _in;
+import "dart:core" as core;
+
+import "dart:_internal";
+import "org-dartlang-testcase:///main_lib.dart" as prefix;
+
+@/* from org-dartlang-testcase:///patch_lib.dart */ _in::patch
+class Class extends core::Object {
+  field core::int _field /* from org-dartlang-testcase:///patch_lib.dart */;
+  synthetic constructor •() → self2::Class
+    ;
+  @_in::patch
+  external method method() → core::int;
+}
+@_in::patch
+extension Extension on core::int {
+  method method = self2::Extension|method;
+  method tearoff method = self2::Extension|get#method;
+  static field _field = self2::Extension|_field;
+}
+static field core::int Extension|_field /* from org-dartlang-testcase:///patch_lib.dart */;
+@_in::patch
+external static extension-member method Extension|method(lowered final core::int #this) → core::int;
+static extension-member method Extension|get#method(lowered final core::int #this) → () → core::int
+  return () → core::int => self2::Extension|method(#this);
+
+library;
+import self as self3;
+import "dart:core" as core;
+
+static const field core::int value = 5;
+
+
+Extra constant evaluation status:
+Evaluated: FileUriExpression @ org-dartlang-testcase:///patch_lib.dart:9:1 -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Extra constant evaluation: evaluated: 7, effectively constant: 4
diff --git a/pkg/front_end/testcases/general/patch_prefix_access/main.dart.strong.transformed.expect b/pkg/front_end/testcases/general/patch_prefix_access/main.dart.strong.transformed.expect
new file mode 100644
index 0000000..9f93060
--- /dev/null
+++ b/pkg/front_end/testcases/general/patch_prefix_access/main.dart.strong.transformed.expect
@@ -0,0 +1,52 @@
+library;
+import self as self;
+import "dart:test" as test;
+import "dart:core" as core;
+
+import "dart:test";
+
+static method main() → dynamic {
+  new test::Class::•().{test::Class::method}(){() → core::int};
+}
+
+library;
+import self as test;
+import "dart:_internal" as _in;
+import "dart:core" as core;
+
+import "dart:_internal";
+import "org-dartlang-testcase:///main_lib.dart" as prefix;
+
+@/* from org-dartlang-testcase:///patch_lib.dart */ #C1
+class Class extends core::Object {
+  field core::int _field = #C2 /* from org-dartlang-testcase:///patch_lib.dart */;
+  synthetic constructor •() → test::Class
+    : super core::Object::•()
+    ;
+  @#C1
+  method /* from org-dartlang-testcase:///patch_lib.dart */ method() → core::int
+    return #C2;
+}
+@#C1
+extension Extension on core::int {
+  method method = test::Extension|method;
+  method tearoff method = test::Extension|get#method;
+  static field _field = test::Extension|_field;
+}
+static field core::int Extension|_field = #C2 /* from org-dartlang-testcase:///patch_lib.dart */;
+@#C1
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|method(lowered final core::int #this) → core::int
+  return #C2;
+static extension-member method Extension|get#method(lowered final core::int #this) → () → core::int
+  return () → core::int => test::Extension|method(#this);
+
+library;
+import self as self2;
+import "dart:core" as core;
+
+static const field core::int value = #C2;
+
+constants  {
+  #C1 = _in::_Patch {}
+  #C2 = 5
+}
diff --git a/pkg/front_end/testcases/general/patch_prefix_access/main.dart.textual_outline.expect b/pkg/front_end/testcases/general/patch_prefix_access/main.dart.textual_outline.expect
new file mode 100644
index 0000000..3c9c90e
--- /dev/null
+++ b/pkg/front_end/testcases/general/patch_prefix_access/main.dart.textual_outline.expect
@@ -0,0 +1,3 @@
+import 'dart:test';
+
+main() {}
diff --git a/pkg/front_end/testcases/general/patch_prefix_access/main.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/general/patch_prefix_access/main.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..3c9c90e
--- /dev/null
+++ b/pkg/front_end/testcases/general/patch_prefix_access/main.dart.textual_outline_modelled.expect
@@ -0,0 +1,3 @@
+import 'dart:test';
+
+main() {}
diff --git a/pkg/front_end/testcases/general/patch_prefix_access/main_lib.dart b/pkg/front_end/testcases/general/patch_prefix_access/main_lib.dart
new file mode 100644
index 0000000..f716d85
--- /dev/null
+++ b/pkg/front_end/testcases/general/patch_prefix_access/main_lib.dart
@@ -0,0 +1,5 @@
+// Copyright (c) 2025, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+const int value = 5;
diff --git a/pkg/front_end/testcases/general/patch_prefix_access/origin_lib.dart b/pkg/front_end/testcases/general/patch_prefix_access/origin_lib.dart
new file mode 100644
index 0000000..ce13e6a
--- /dev/null
+++ b/pkg/front_end/testcases/general/patch_prefix_access/origin_lib.dart
@@ -0,0 +1,11 @@
+// Copyright (c) 2025, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+class Class {
+  external int method();
+}
+
+extension Extension on int {
+  external int method();
+}
diff --git a/pkg/front_end/testcases/general/patch_prefix_access/patch_lib.dart b/pkg/front_end/testcases/general/patch_prefix_access/patch_lib.dart
new file mode 100644
index 0000000..511df0a
--- /dev/null
+++ b/pkg/front_end/testcases/general/patch_prefix_access/patch_lib.dart
@@ -0,0 +1,23 @@
+// Copyright (c) 2025, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// ignore: import_internal_library
+import 'dart:_internal';
+import 'main_lib.dart' as prefix;
+
+@patch
+class Class {
+  int _field = prefix.value;
+
+  @patch
+  int method() => prefix.value;
+}
+
+@patch
+extension Extension on int {
+  static int _field = prefix.value;
+
+  @patch
+  int method() => prefix.value;
+}
diff --git a/pkg/front_end/testcases/general/patch_type_parameters/libraries.json b/pkg/front_end/testcases/general/patch_type_parameters/libraries.json
new file mode 100644
index 0000000..79373ad
--- /dev/null
+++ b/pkg/front_end/testcases/general/patch_type_parameters/libraries.json
@@ -0,0 +1,13 @@
+{
+  "vm": {
+    "comment:0": "This adds to the default libraries found in the platform.",
+    "libraries": {
+      "test": {
+        "patches": [
+          "patch_lib.dart"
+        ],
+        "uri": "origin_lib.dart"
+      }
+    }
+  }
+}
diff --git a/pkg/front_end/testcases/general/patch_type_parameters/main.dart b/pkg/front_end/testcases/general/patch_type_parameters/main.dart
new file mode 100644
index 0000000..e479d13
--- /dev/null
+++ b/pkg/front_end/testcases/general/patch_type_parameters/main.dart
@@ -0,0 +1,14 @@
+// Copyright (c) 2025, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:test';
+
+main() {
+  Class<Bound>().method<Bound>(); // Ok
+}
+
+test() {
+  Class<Bound?>(); // Error
+  Class<Bound>().method<Bound?>(); // Error
+}
diff --git a/pkg/front_end/testcases/general/patch_type_parameters/main.dart.strong.expect b/pkg/front_end/testcases/general/patch_type_parameters/main.dart.strong.expect
new file mode 100644
index 0000000..84843bb
--- /dev/null
+++ b/pkg/front_end/testcases/general/patch_type_parameters/main.dart.strong.expect
@@ -0,0 +1,58 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/general/patch_type_parameters/main.dart:12:3: Error: Type argument 'Bound?' doesn't conform to the bound 'Bound' of the type variable 'T' on 'Class'.
+//  - 'Bound' is from 'dart:test'.
+// Try changing type arguments so that they conform to the bounds.
+//   Class<Bound?>(); // Error
+//   ^
+// pkg/front_end/testcases/general/patch_type_parameters/origin_lib.dart:7:13: Context: This is the type variable whose bound isn't conformed to.
+// class Class<T extends Bound> {
+//             ^
+//
+// pkg/front_end/testcases/general/patch_type_parameters/main.dart:13:18: Error: Type argument 'Bound?' doesn't conform to the bound 'Object' of the type variable 'S' on 'Class<Bound>.method'.
+//  - 'Bound' is from 'dart:test'.
+//  - 'Object' is from 'dart:core'.
+//  - 'Class' is from 'dart:test'.
+// Try changing type arguments so that they conform to the bounds.
+//   Class<Bound>().method<Bound?>(); // Error
+//                  ^
+//
+import self as self;
+import "dart:test" as test;
+
+import "dart:test";
+
+static method main() → dynamic {
+  new test::Class::•<test::Bound>().{test::Class::method}<test::Bound>(){() → void};
+}
+static method test() → dynamic {
+  new test::Class::•<test::Bound?>();
+  new test::Class::•<test::Bound>().{test::Class::method}<test::Bound?>(){() → void};
+}
+
+library;
+import self as test;
+import "dart:core" as core;
+import "dart:_internal" as _in;
+
+import "dart:_internal";
+
+class Bound extends core::Object {
+  synthetic constructor •() → test::Bound
+    : super core::Object::•()
+    ;
+}
+@/* from org-dartlang-testcase:///patch_lib.dart */ #C1
+class Class<T extends test::Bound> extends core::Object {
+  synthetic constructor •() → test::Class<test::Class::T>
+    : super core::Object::•()
+    ;
+  @#C1
+  method /* from org-dartlang-testcase:///patch_lib.dart */ method<T extends test::Bound = dynamic>() → void {}
+}
+
+constants  {
+  #C1 = _in::_Patch {}
+}
diff --git a/pkg/front_end/testcases/general/patch_type_parameters/main.dart.strong.modular.expect b/pkg/front_end/testcases/general/patch_type_parameters/main.dart.strong.modular.expect
new file mode 100644
index 0000000..84843bb
--- /dev/null
+++ b/pkg/front_end/testcases/general/patch_type_parameters/main.dart.strong.modular.expect
@@ -0,0 +1,58 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/general/patch_type_parameters/main.dart:12:3: Error: Type argument 'Bound?' doesn't conform to the bound 'Bound' of the type variable 'T' on 'Class'.
+//  - 'Bound' is from 'dart:test'.
+// Try changing type arguments so that they conform to the bounds.
+//   Class<Bound?>(); // Error
+//   ^
+// pkg/front_end/testcases/general/patch_type_parameters/origin_lib.dart:7:13: Context: This is the type variable whose bound isn't conformed to.
+// class Class<T extends Bound> {
+//             ^
+//
+// pkg/front_end/testcases/general/patch_type_parameters/main.dart:13:18: Error: Type argument 'Bound?' doesn't conform to the bound 'Object' of the type variable 'S' on 'Class<Bound>.method'.
+//  - 'Bound' is from 'dart:test'.
+//  - 'Object' is from 'dart:core'.
+//  - 'Class' is from 'dart:test'.
+// Try changing type arguments so that they conform to the bounds.
+//   Class<Bound>().method<Bound?>(); // Error
+//                  ^
+//
+import self as self;
+import "dart:test" as test;
+
+import "dart:test";
+
+static method main() → dynamic {
+  new test::Class::•<test::Bound>().{test::Class::method}<test::Bound>(){() → void};
+}
+static method test() → dynamic {
+  new test::Class::•<test::Bound?>();
+  new test::Class::•<test::Bound>().{test::Class::method}<test::Bound?>(){() → void};
+}
+
+library;
+import self as test;
+import "dart:core" as core;
+import "dart:_internal" as _in;
+
+import "dart:_internal";
+
+class Bound extends core::Object {
+  synthetic constructor •() → test::Bound
+    : super core::Object::•()
+    ;
+}
+@/* from org-dartlang-testcase:///patch_lib.dart */ #C1
+class Class<T extends test::Bound> extends core::Object {
+  synthetic constructor •() → test::Class<test::Class::T>
+    : super core::Object::•()
+    ;
+  @#C1
+  method /* from org-dartlang-testcase:///patch_lib.dart */ method<T extends test::Bound = dynamic>() → void {}
+}
+
+constants  {
+  #C1 = _in::_Patch {}
+}
diff --git a/pkg/front_end/testcases/general/patch_type_parameters/main.dart.strong.outline.expect b/pkg/front_end/testcases/general/patch_type_parameters/main.dart.strong.outline.expect
new file mode 100644
index 0000000..8498668
--- /dev/null
+++ b/pkg/front_end/testcases/general/patch_type_parameters/main.dart.strong.outline.expect
@@ -0,0 +1,34 @@
+library;
+import self as self;
+
+import "dart:test";
+
+static method main() → dynamic
+  ;
+static method test() → dynamic
+  ;
+
+library;
+import self as self2;
+import "dart:core" as core;
+import "dart:_internal" as _in;
+
+import "dart:_internal";
+
+class Bound extends core::Object {
+  synthetic constructor •() → self2::Bound
+    ;
+}
+@/* from org-dartlang-testcase:///patch_lib.dart */ _in::patch
+class Class<T extends self2::Bound> extends core::Object {
+  synthetic constructor •() → self2::Class<self2::Class::T>
+    ;
+  @_in::patch
+  external method method<S extends core::Object>() → void;
+}
+
+
+Extra constant evaluation status:
+Evaluated: FileUriExpression @ org-dartlang-testcase:///patch_lib.dart:8:1 -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Extra constant evaluation: evaluated: 2, effectively constant: 2
diff --git a/pkg/front_end/testcases/general/patch_type_parameters/main.dart.strong.transformed.expect b/pkg/front_end/testcases/general/patch_type_parameters/main.dart.strong.transformed.expect
new file mode 100644
index 0000000..84843bb
--- /dev/null
+++ b/pkg/front_end/testcases/general/patch_type_parameters/main.dart.strong.transformed.expect
@@ -0,0 +1,58 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/general/patch_type_parameters/main.dart:12:3: Error: Type argument 'Bound?' doesn't conform to the bound 'Bound' of the type variable 'T' on 'Class'.
+//  - 'Bound' is from 'dart:test'.
+// Try changing type arguments so that they conform to the bounds.
+//   Class<Bound?>(); // Error
+//   ^
+// pkg/front_end/testcases/general/patch_type_parameters/origin_lib.dart:7:13: Context: This is the type variable whose bound isn't conformed to.
+// class Class<T extends Bound> {
+//             ^
+//
+// pkg/front_end/testcases/general/patch_type_parameters/main.dart:13:18: Error: Type argument 'Bound?' doesn't conform to the bound 'Object' of the type variable 'S' on 'Class<Bound>.method'.
+//  - 'Bound' is from 'dart:test'.
+//  - 'Object' is from 'dart:core'.
+//  - 'Class' is from 'dart:test'.
+// Try changing type arguments so that they conform to the bounds.
+//   Class<Bound>().method<Bound?>(); // Error
+//                  ^
+//
+import self as self;
+import "dart:test" as test;
+
+import "dart:test";
+
+static method main() → dynamic {
+  new test::Class::•<test::Bound>().{test::Class::method}<test::Bound>(){() → void};
+}
+static method test() → dynamic {
+  new test::Class::•<test::Bound?>();
+  new test::Class::•<test::Bound>().{test::Class::method}<test::Bound?>(){() → void};
+}
+
+library;
+import self as test;
+import "dart:core" as core;
+import "dart:_internal" as _in;
+
+import "dart:_internal";
+
+class Bound extends core::Object {
+  synthetic constructor •() → test::Bound
+    : super core::Object::•()
+    ;
+}
+@/* from org-dartlang-testcase:///patch_lib.dart */ #C1
+class Class<T extends test::Bound> extends core::Object {
+  synthetic constructor •() → test::Class<test::Class::T>
+    : super core::Object::•()
+    ;
+  @#C1
+  method /* from org-dartlang-testcase:///patch_lib.dart */ method<T extends test::Bound = dynamic>() → void {}
+}
+
+constants  {
+  #C1 = _in::_Patch {}
+}
diff --git a/pkg/front_end/testcases/general/patch_type_parameters/main.dart.textual_outline.expect b/pkg/front_end/testcases/general/patch_type_parameters/main.dart.textual_outline.expect
new file mode 100644
index 0000000..03bba73
--- /dev/null
+++ b/pkg/front_end/testcases/general/patch_type_parameters/main.dart.textual_outline.expect
@@ -0,0 +1,5 @@
+import 'dart:test';
+
+main() {}
+
+test() {}
diff --git a/pkg/front_end/testcases/general/patch_type_parameters/main.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/general/patch_type_parameters/main.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..03bba73
--- /dev/null
+++ b/pkg/front_end/testcases/general/patch_type_parameters/main.dart.textual_outline_modelled.expect
@@ -0,0 +1,5 @@
+import 'dart:test';
+
+main() {}
+
+test() {}
diff --git a/pkg/front_end/testcases/general/patch_type_parameters/origin_lib.dart b/pkg/front_end/testcases/general/patch_type_parameters/origin_lib.dart
new file mode 100644
index 0000000..7da39f9
--- /dev/null
+++ b/pkg/front_end/testcases/general/patch_type_parameters/origin_lib.dart
@@ -0,0 +1,9 @@
+// Copyright (c) 2025, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+class Bound {}
+
+class Class<T extends Bound> {
+  external void method<S extends Object>();
+}
diff --git a/pkg/front_end/testcases/general/patch_type_parameters/patch_lib.dart b/pkg/front_end/testcases/general/patch_type_parameters/patch_lib.dart
new file mode 100644
index 0000000..3a7e98d
--- /dev/null
+++ b/pkg/front_end/testcases/general/patch_type_parameters/patch_lib.dart
@@ -0,0 +1,12 @@
+// Copyright (c) 2025, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// ignore: import_internal_library
+import 'dart:_internal';
+
+@patch
+class Class<T extends Bound> {
+  @patch
+  void method<T extends Bound>() {}
+}
diff --git a/pkg/front_end/testcases/general/patching/libraries.json b/pkg/front_end/testcases/general/patching/libraries.json
new file mode 100644
index 0000000..79373ad
--- /dev/null
+++ b/pkg/front_end/testcases/general/patching/libraries.json
@@ -0,0 +1,13 @@
+{
+  "vm": {
+    "comment:0": "This adds to the default libraries found in the platform.",
+    "libraries": {
+      "test": {
+        "patches": [
+          "patch_lib.dart"
+        ],
+        "uri": "origin_lib.dart"
+      }
+    }
+  }
+}
diff --git a/pkg/front_end/testcases/general/patching/main.dart b/pkg/front_end/testcases/general/patching/main.dart
new file mode 100644
index 0000000..b9a694d
--- /dev/null
+++ b/pkg/front_end/testcases/general/patching/main.dart
@@ -0,0 +1,33 @@
+// Copyright (c) 2025, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:test';
+
+main() {
+  topLevelSetter = topLevelGetter;
+  topLevelMethod(42);
+  topLevelMethod;
+  var c = Class(42);
+  Class.new;
+  Class.redirecting(42);
+  Class.redirecting;
+  Class.factory(42);
+  Class.factory;
+  Class.redirectingFactory(42);
+  Class.redirectingFactory;
+  c.instanceSetter = c.instanceGetter;
+  c.instanceMethod(42);
+  c.instanceMethod;
+  c + c;
+  Class.staticSetter = Class.staticGetter;
+  Class.staticMethod(42);
+  Class.staticMethod;
+  c.extensionInstanceSetter = c.extensionInstanceGetter;
+  c.extensionInstanceMethod(42);
+  c.extensionInstanceMethod;
+  c - c;
+  Extension.extensionStaticSetter = Extension.extensionStaticGetter;
+  Extension.extensionStaticMethod(42);
+  Extension.extensionStaticMethod;
+}
diff --git a/pkg/front_end/testcases/general/patching/main.dart.strong.expect b/pkg/front_end/testcases/general/patching/main.dart.strong.expect
new file mode 100644
index 0000000..62bfec3
--- /dev/null
+++ b/pkg/front_end/testcases/general/patching/main.dart.strong.expect
@@ -0,0 +1,238 @@
+library;
+import self as self;
+import "dart:test" as test;
+import "dart:core" as core;
+
+import "dart:test";
+
+static method main() → dynamic {
+  test::topLevelSetter = test::topLevelGetter;
+  test::topLevelMethod(42);
+  #C1;
+  test::Class c = new test::Class::•(42);
+  #C2;
+  new test::Class::redirecting(42);
+  #C3;
+  test::Class::factory(42);
+  #C4;
+  new test::Class::•(42);
+  #C5;
+  c.{test::Class::instanceSetter} = c.{test::Class::instanceGetter}{core::int};
+  c.{test::Class::instanceMethod}(42){(core::int) → void};
+  c.{test::Class::instanceMethod}{(core::int) → void};
+  c.{test::Class::+}(c){(test::Class) → test::Class};
+  test::Class::staticSetter = test::Class::staticGetter;
+  test::Class::staticMethod(42);
+  #C6;
+  test::Extension|set#extensionInstanceSetter(c, test::Extension|get#extensionInstanceGetter(c));
+  test::Extension|extensionInstanceMethod(c, 42);
+  test::Extension|get#extensionInstanceMethod(c);
+  test::Extension|-(c, c);
+  test::Extension|extensionStaticSetter = test::Extension|extensionStaticGetter;
+  test::Extension|extensionStaticMethod(42);
+  #C7;
+}
+
+library;
+import self as test;
+import "dart:_internal" as _in;
+import "dart:core" as core;
+
+import "dart:_internal";
+
+@/* from org-dartlang-testcase:///patch_lib.dart */ #C8
+class Class extends core::Object {
+  @#C8
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ •(core::int value) → test::Class
+    : super core::Object::•()
+    ;
+  @#C8
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ redirecting(core::int value) → test::Class
+    : this test::Class::•(value)
+    ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _injectedGenerative(core::int value) → test::Class
+    : super core::Object::•()
+    ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _injectedRedirecting(core::int value) → test::Class
+    : this test::Class::•(value)
+    ;
+  @#C8
+  static factory /* from org-dartlang-testcase:///patch_lib.dart */ factory(core::int value) → test::Class
+    return new test::Class::•(value);
+  @#C8
+  static factory /* from org-dartlang-testcase:///patch_lib.dart */ redirectingFactory(core::int value) → test::Class /* redirection-target: test::Class::• */
+    return new test::Class::•(value);
+  @#C8
+  get /* from org-dartlang-testcase:///patch_lib.dart */ instanceGetter() → core::int
+    return 42;
+  @#C8
+  set /* from org-dartlang-testcase:///patch_lib.dart */ instanceSetter(core::int value) → void {}
+  @#C8
+  method /* from org-dartlang-testcase:///patch_lib.dart */ instanceMethod(core::int value) → void {}
+  @#C8
+  operator /* from org-dartlang-testcase:///patch_lib.dart */ +(test::Class a) → test::Class
+    return this;
+  @#C8
+  static get /* from org-dartlang-testcase:///patch_lib.dart */ staticGetter() → core::int
+    return 42;
+  @#C8
+  static set /* from org-dartlang-testcase:///patch_lib.dart */ staticSetter(core::int value) → void {}
+  @#C8
+  static method /* from org-dartlang-testcase:///patch_lib.dart */ staticMethod(core::int value) → void {}
+  static factory /* from org-dartlang-testcase:///patch_lib.dart */ _injectedFactory(core::int value) → test::Class
+    return new test::Class::•(value);
+  static factory /* from org-dartlang-testcase:///patch_lib.dart */ _injectedRedirectingFactory(core::int value) → test::Class /* redirection-target: test::Class::• */
+    return new test::Class::•(value);
+  get /* from org-dartlang-testcase:///patch_lib.dart */ _injectedInstanceGetter() → core::int
+    return 42;
+  set /* from org-dartlang-testcase:///patch_lib.dart */ _injectedInstanceSetter(core::int value) → void {}
+  method /* from org-dartlang-testcase:///patch_lib.dart */ _injectedInstanceMethod(core::int value) → void {}
+  static get /* from org-dartlang-testcase:///patch_lib.dart */ _injectedStaticGetter() → core::int
+    return 42;
+  static set /* from org-dartlang-testcase:///patch_lib.dart */ _injectedStaticSetter(core::int value) → void {}
+  static method /* from org-dartlang-testcase:///patch_lib.dart */ _injectedStaticMethod(core::int value) → void {}
+}
+class _InjectedClass extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  field core::int instanceField = 42;
+  static field core::int staticField = 42;
+  constructor •(core::int value) → test::_InjectedClass
+    : super core::Object::•()
+    ;
+  constructor redirecting(core::int value) → test::_InjectedClass
+    : this test::_InjectedClass::•(value)
+    ;
+  static factory factory(core::int value) → test::_InjectedClass
+    return new test::_InjectedClass::•(value);
+  static factory redirectingFactory(core::int value) → test::_InjectedClass /* redirection-target: test::_InjectedClass::• */
+    return new test::_InjectedClass::•(value);
+  get instanceGetter() → core::int
+    return 42;
+  set instanceSetter(core::int value) → void {}
+  method instanceMethod(core::int value) → void {}
+  static get staticGetter() → core::int
+    return 42;
+  static set staticSetter(core::int value) → void {}
+  static method staticMethod(core::int value) → void {}
+}
+@#C8
+extension Extension on test::Class {
+  get extensionInstanceGetter = test::Extension|get#extensionInstanceGetter;
+  method extensionInstanceMethod = test::Extension|extensionInstanceMethod;
+  method tearoff extensionInstanceMethod = test::Extension|get#extensionInstanceMethod;
+  operator - = test::Extension|-;
+  static get extensionStaticGetter = get test::Extension|extensionStaticGetter;
+  static method extensionStaticMethod = test::Extension|extensionStaticMethod;
+  get _injectedExtensionInstanceGetter = test::Extension|get#_injectedExtensionInstanceGetter;
+  method _injectedExtensionInstanceMethod = test::Extension|_injectedExtensionInstanceMethod;
+  method tearoff _injectedExtensionInstanceMethod = test::Extension|get#_injectedExtensionInstanceMethod;
+  static field _injectedExtensionStaticField = test::Extension|_injectedExtensionStaticField;
+  static get _injectedExtensionStaticGetter = get test::Extension|_injectedExtensionStaticGetter;
+  static method _injectedExtensionStaticMethod = test::Extension|_injectedExtensionStaticMethod;
+  set extensionInstanceSetter = test::Extension|set#extensionInstanceSetter;
+  static set extensionStaticSetter = set test::Extension|extensionStaticSetter;
+  set _injectedExtensionInstanceSetter = test::Extension|set#_injectedExtensionInstanceSetter;
+  static set _injectedExtensionStaticSetter = set test::Extension|_injectedExtensionStaticSetter;
+}
+static field core::int Extension|_injectedExtensionStaticField = 42 /* from org-dartlang-testcase:///patch_lib.dart */;
+@#C8
+static get /* from org-dartlang-testcase:///patch_lib.dart */ topLevelGetter() → core::int
+  return 42;
+@#C8
+static set /* from org-dartlang-testcase:///patch_lib.dart */ topLevelSetter(core::int value) → void {}
+@#C8
+static method /* from org-dartlang-testcase:///patch_lib.dart */ topLevelMethod(core::int value) → void {}
+@#C8
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|get#extensionInstanceGetter(lowered final test::Class #this) → core::int
+  return 42;
+@#C8
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|set#extensionInstanceSetter(lowered final test::Class #this, core::int value) → void {}
+@#C8
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|extensionInstanceMethod(lowered final test::Class #this, core::int value) → void {}
+static extension-member method Extension|get#extensionInstanceMethod(lowered final test::Class #this) → (core::int) → void
+  return (core::int value) → void => test::Extension|extensionInstanceMethod(#this, value);
+@#C8
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|-(lowered final test::Class #this, test::Class a) → test::Class
+  return #this;
+@#C8
+static extension-member get /* from org-dartlang-testcase:///patch_lib.dart */ Extension|extensionStaticGetter() → core::int
+  return 42;
+@#C8
+static extension-member set /* from org-dartlang-testcase:///patch_lib.dart */ Extension|extensionStaticSetter(core::int value) → void {}
+@#C8
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|extensionStaticMethod(core::int value) → void {}
+static get /* from org-dartlang-testcase:///patch_lib.dart */ _injectedTopLevelGetter() → core::int
+  return 42;
+static set /* from org-dartlang-testcase:///patch_lib.dart */ _injectedTopLevelSetter(core::int value) → void {}
+static method /* from org-dartlang-testcase:///patch_lib.dart */ _injectedTopLevelMethod(core::int value) → void {
+  test::_injectedTopLevelSetter = test::_injectedTopLevelGetter;
+  test::_injectedTopLevelMethod(42);
+  #C9;
+  test::_InjectedClass i = new test::_InjectedClass::•(42);
+  #C10;
+  new test::_InjectedClass::redirecting(42);
+  #C11;
+  test::_InjectedClass::factory(42);
+  #C12;
+  new test::_InjectedClass::•(42);
+  #C13;
+  i.{test::_InjectedClass::instanceSetter} = i.{test::_InjectedClass::instanceGetter}{core::int};
+  i.{test::_InjectedClass::instanceMethod}(42){(core::int) → void};
+  i.{test::_InjectedClass::instanceMethod}{(core::int) → void};
+  test::_InjectedClass::staticSetter = test::_InjectedClass::staticGetter;
+  test::_InjectedClass::staticMethod(42);
+  #C14;
+  test::Class c = new test::Class::•(42);
+  new test::Class::_injectedGenerative(42);
+  #C15;
+  new test::Class::_injectedRedirecting(42);
+  #C16;
+  test::Class::_injectedFactory(42);
+  #C17;
+  new test::Class::•(42);
+  #C18;
+  c.{test::Class::_injectedInstanceSetter} = c.{test::Class::_injectedInstanceGetter}{core::int};
+  c.{test::Class::_injectedInstanceMethod}(42){(core::int) → void};
+  c.{test::Class::_injectedInstanceMethod}{(core::int) → void};
+  test::Class::_injectedStaticSetter = test::Class::_injectedStaticGetter;
+  test::Class::_injectedStaticMethod(42);
+  #C19;
+  test::Extension|set#_injectedExtensionInstanceSetter(c, test::Extension|get#_injectedExtensionInstanceGetter(c));
+  test::Extension|_injectedExtensionInstanceMethod(c, 42);
+  test::Extension|get#_injectedExtensionInstanceMethod(c);
+  test::Extension|_injectedExtensionStaticSetter = test::Extension|_injectedExtensionStaticGetter;
+  test::Extension|_injectedExtensionStaticMethod(42);
+  #C20;
+}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|get#_injectedExtensionInstanceGetter(lowered final test::Class #this) → core::int
+  return 42;
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|set#_injectedExtensionInstanceSetter(lowered final test::Class #this, core::int value) → void {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|_injectedExtensionInstanceMethod(lowered final test::Class #this, core::int value) → void {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|get#_injectedExtensionInstanceMethod(lowered final test::Class #this) → (core::int) → void
+  return (core::int value) → void => test::Extension|_injectedExtensionInstanceMethod(#this, value);
+static extension-member get /* from org-dartlang-testcase:///patch_lib.dart */ Extension|_injectedExtensionStaticGetter() → core::int
+  return 42;
+static extension-member set /* from org-dartlang-testcase:///patch_lib.dart */ Extension|_injectedExtensionStaticSetter(core::int value) → void {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|_injectedExtensionStaticMethod(core::int value) → void {}
+
+constants  {
+  #C1 = static-tearoff test::topLevelMethod
+  #C2 = constructor-tearoff test::Class::•
+  #C3 = constructor-tearoff test::Class::redirecting
+  #C4 = constructor-tearoff test::Class::factory
+  #C5 = redirecting-factory-tearoff test::Class::redirectingFactory
+  #C6 = static-tearoff test::Class::staticMethod
+  #C7 = static-tearoff test::Extension|extensionStaticMethod
+  #C8 = _in::_Patch {}
+  #C9 = static-tearoff test::_injectedTopLevelMethod
+  #C10 = constructor-tearoff test::_InjectedClass::•
+  #C11 = constructor-tearoff test::_InjectedClass::redirecting
+  #C12 = constructor-tearoff test::_InjectedClass::factory
+  #C13 = redirecting-factory-tearoff test::_InjectedClass::redirectingFactory
+  #C14 = static-tearoff test::_InjectedClass::staticMethod
+  #C15 = constructor-tearoff test::Class::_injectedGenerative
+  #C16 = constructor-tearoff test::Class::_injectedRedirecting
+  #C17 = constructor-tearoff test::Class::_injectedFactory
+  #C18 = redirecting-factory-tearoff test::Class::_injectedRedirectingFactory
+  #C19 = static-tearoff test::Class::_injectedStaticMethod
+  #C20 = static-tearoff test::Extension|_injectedExtensionStaticMethod
+}
diff --git a/pkg/front_end/testcases/general/patching/main.dart.strong.modular.expect b/pkg/front_end/testcases/general/patching/main.dart.strong.modular.expect
new file mode 100644
index 0000000..62bfec3
--- /dev/null
+++ b/pkg/front_end/testcases/general/patching/main.dart.strong.modular.expect
@@ -0,0 +1,238 @@
+library;
+import self as self;
+import "dart:test" as test;
+import "dart:core" as core;
+
+import "dart:test";
+
+static method main() → dynamic {
+  test::topLevelSetter = test::topLevelGetter;
+  test::topLevelMethod(42);
+  #C1;
+  test::Class c = new test::Class::•(42);
+  #C2;
+  new test::Class::redirecting(42);
+  #C3;
+  test::Class::factory(42);
+  #C4;
+  new test::Class::•(42);
+  #C5;
+  c.{test::Class::instanceSetter} = c.{test::Class::instanceGetter}{core::int};
+  c.{test::Class::instanceMethod}(42){(core::int) → void};
+  c.{test::Class::instanceMethod}{(core::int) → void};
+  c.{test::Class::+}(c){(test::Class) → test::Class};
+  test::Class::staticSetter = test::Class::staticGetter;
+  test::Class::staticMethod(42);
+  #C6;
+  test::Extension|set#extensionInstanceSetter(c, test::Extension|get#extensionInstanceGetter(c));
+  test::Extension|extensionInstanceMethod(c, 42);
+  test::Extension|get#extensionInstanceMethod(c);
+  test::Extension|-(c, c);
+  test::Extension|extensionStaticSetter = test::Extension|extensionStaticGetter;
+  test::Extension|extensionStaticMethod(42);
+  #C7;
+}
+
+library;
+import self as test;
+import "dart:_internal" as _in;
+import "dart:core" as core;
+
+import "dart:_internal";
+
+@/* from org-dartlang-testcase:///patch_lib.dart */ #C8
+class Class extends core::Object {
+  @#C8
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ •(core::int value) → test::Class
+    : super core::Object::•()
+    ;
+  @#C8
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ redirecting(core::int value) → test::Class
+    : this test::Class::•(value)
+    ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _injectedGenerative(core::int value) → test::Class
+    : super core::Object::•()
+    ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _injectedRedirecting(core::int value) → test::Class
+    : this test::Class::•(value)
+    ;
+  @#C8
+  static factory /* from org-dartlang-testcase:///patch_lib.dart */ factory(core::int value) → test::Class
+    return new test::Class::•(value);
+  @#C8
+  static factory /* from org-dartlang-testcase:///patch_lib.dart */ redirectingFactory(core::int value) → test::Class /* redirection-target: test::Class::• */
+    return new test::Class::•(value);
+  @#C8
+  get /* from org-dartlang-testcase:///patch_lib.dart */ instanceGetter() → core::int
+    return 42;
+  @#C8
+  set /* from org-dartlang-testcase:///patch_lib.dart */ instanceSetter(core::int value) → void {}
+  @#C8
+  method /* from org-dartlang-testcase:///patch_lib.dart */ instanceMethod(core::int value) → void {}
+  @#C8
+  operator /* from org-dartlang-testcase:///patch_lib.dart */ +(test::Class a) → test::Class
+    return this;
+  @#C8
+  static get /* from org-dartlang-testcase:///patch_lib.dart */ staticGetter() → core::int
+    return 42;
+  @#C8
+  static set /* from org-dartlang-testcase:///patch_lib.dart */ staticSetter(core::int value) → void {}
+  @#C8
+  static method /* from org-dartlang-testcase:///patch_lib.dart */ staticMethod(core::int value) → void {}
+  static factory /* from org-dartlang-testcase:///patch_lib.dart */ _injectedFactory(core::int value) → test::Class
+    return new test::Class::•(value);
+  static factory /* from org-dartlang-testcase:///patch_lib.dart */ _injectedRedirectingFactory(core::int value) → test::Class /* redirection-target: test::Class::• */
+    return new test::Class::•(value);
+  get /* from org-dartlang-testcase:///patch_lib.dart */ _injectedInstanceGetter() → core::int
+    return 42;
+  set /* from org-dartlang-testcase:///patch_lib.dart */ _injectedInstanceSetter(core::int value) → void {}
+  method /* from org-dartlang-testcase:///patch_lib.dart */ _injectedInstanceMethod(core::int value) → void {}
+  static get /* from org-dartlang-testcase:///patch_lib.dart */ _injectedStaticGetter() → core::int
+    return 42;
+  static set /* from org-dartlang-testcase:///patch_lib.dart */ _injectedStaticSetter(core::int value) → void {}
+  static method /* from org-dartlang-testcase:///patch_lib.dart */ _injectedStaticMethod(core::int value) → void {}
+}
+class _InjectedClass extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  field core::int instanceField = 42;
+  static field core::int staticField = 42;
+  constructor •(core::int value) → test::_InjectedClass
+    : super core::Object::•()
+    ;
+  constructor redirecting(core::int value) → test::_InjectedClass
+    : this test::_InjectedClass::•(value)
+    ;
+  static factory factory(core::int value) → test::_InjectedClass
+    return new test::_InjectedClass::•(value);
+  static factory redirectingFactory(core::int value) → test::_InjectedClass /* redirection-target: test::_InjectedClass::• */
+    return new test::_InjectedClass::•(value);
+  get instanceGetter() → core::int
+    return 42;
+  set instanceSetter(core::int value) → void {}
+  method instanceMethod(core::int value) → void {}
+  static get staticGetter() → core::int
+    return 42;
+  static set staticSetter(core::int value) → void {}
+  static method staticMethod(core::int value) → void {}
+}
+@#C8
+extension Extension on test::Class {
+  get extensionInstanceGetter = test::Extension|get#extensionInstanceGetter;
+  method extensionInstanceMethod = test::Extension|extensionInstanceMethod;
+  method tearoff extensionInstanceMethod = test::Extension|get#extensionInstanceMethod;
+  operator - = test::Extension|-;
+  static get extensionStaticGetter = get test::Extension|extensionStaticGetter;
+  static method extensionStaticMethod = test::Extension|extensionStaticMethod;
+  get _injectedExtensionInstanceGetter = test::Extension|get#_injectedExtensionInstanceGetter;
+  method _injectedExtensionInstanceMethod = test::Extension|_injectedExtensionInstanceMethod;
+  method tearoff _injectedExtensionInstanceMethod = test::Extension|get#_injectedExtensionInstanceMethod;
+  static field _injectedExtensionStaticField = test::Extension|_injectedExtensionStaticField;
+  static get _injectedExtensionStaticGetter = get test::Extension|_injectedExtensionStaticGetter;
+  static method _injectedExtensionStaticMethod = test::Extension|_injectedExtensionStaticMethod;
+  set extensionInstanceSetter = test::Extension|set#extensionInstanceSetter;
+  static set extensionStaticSetter = set test::Extension|extensionStaticSetter;
+  set _injectedExtensionInstanceSetter = test::Extension|set#_injectedExtensionInstanceSetter;
+  static set _injectedExtensionStaticSetter = set test::Extension|_injectedExtensionStaticSetter;
+}
+static field core::int Extension|_injectedExtensionStaticField = 42 /* from org-dartlang-testcase:///patch_lib.dart */;
+@#C8
+static get /* from org-dartlang-testcase:///patch_lib.dart */ topLevelGetter() → core::int
+  return 42;
+@#C8
+static set /* from org-dartlang-testcase:///patch_lib.dart */ topLevelSetter(core::int value) → void {}
+@#C8
+static method /* from org-dartlang-testcase:///patch_lib.dart */ topLevelMethod(core::int value) → void {}
+@#C8
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|get#extensionInstanceGetter(lowered final test::Class #this) → core::int
+  return 42;
+@#C8
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|set#extensionInstanceSetter(lowered final test::Class #this, core::int value) → void {}
+@#C8
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|extensionInstanceMethod(lowered final test::Class #this, core::int value) → void {}
+static extension-member method Extension|get#extensionInstanceMethod(lowered final test::Class #this) → (core::int) → void
+  return (core::int value) → void => test::Extension|extensionInstanceMethod(#this, value);
+@#C8
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|-(lowered final test::Class #this, test::Class a) → test::Class
+  return #this;
+@#C8
+static extension-member get /* from org-dartlang-testcase:///patch_lib.dart */ Extension|extensionStaticGetter() → core::int
+  return 42;
+@#C8
+static extension-member set /* from org-dartlang-testcase:///patch_lib.dart */ Extension|extensionStaticSetter(core::int value) → void {}
+@#C8
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|extensionStaticMethod(core::int value) → void {}
+static get /* from org-dartlang-testcase:///patch_lib.dart */ _injectedTopLevelGetter() → core::int
+  return 42;
+static set /* from org-dartlang-testcase:///patch_lib.dart */ _injectedTopLevelSetter(core::int value) → void {}
+static method /* from org-dartlang-testcase:///patch_lib.dart */ _injectedTopLevelMethod(core::int value) → void {
+  test::_injectedTopLevelSetter = test::_injectedTopLevelGetter;
+  test::_injectedTopLevelMethod(42);
+  #C9;
+  test::_InjectedClass i = new test::_InjectedClass::•(42);
+  #C10;
+  new test::_InjectedClass::redirecting(42);
+  #C11;
+  test::_InjectedClass::factory(42);
+  #C12;
+  new test::_InjectedClass::•(42);
+  #C13;
+  i.{test::_InjectedClass::instanceSetter} = i.{test::_InjectedClass::instanceGetter}{core::int};
+  i.{test::_InjectedClass::instanceMethod}(42){(core::int) → void};
+  i.{test::_InjectedClass::instanceMethod}{(core::int) → void};
+  test::_InjectedClass::staticSetter = test::_InjectedClass::staticGetter;
+  test::_InjectedClass::staticMethod(42);
+  #C14;
+  test::Class c = new test::Class::•(42);
+  new test::Class::_injectedGenerative(42);
+  #C15;
+  new test::Class::_injectedRedirecting(42);
+  #C16;
+  test::Class::_injectedFactory(42);
+  #C17;
+  new test::Class::•(42);
+  #C18;
+  c.{test::Class::_injectedInstanceSetter} = c.{test::Class::_injectedInstanceGetter}{core::int};
+  c.{test::Class::_injectedInstanceMethod}(42){(core::int) → void};
+  c.{test::Class::_injectedInstanceMethod}{(core::int) → void};
+  test::Class::_injectedStaticSetter = test::Class::_injectedStaticGetter;
+  test::Class::_injectedStaticMethod(42);
+  #C19;
+  test::Extension|set#_injectedExtensionInstanceSetter(c, test::Extension|get#_injectedExtensionInstanceGetter(c));
+  test::Extension|_injectedExtensionInstanceMethod(c, 42);
+  test::Extension|get#_injectedExtensionInstanceMethod(c);
+  test::Extension|_injectedExtensionStaticSetter = test::Extension|_injectedExtensionStaticGetter;
+  test::Extension|_injectedExtensionStaticMethod(42);
+  #C20;
+}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|get#_injectedExtensionInstanceGetter(lowered final test::Class #this) → core::int
+  return 42;
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|set#_injectedExtensionInstanceSetter(lowered final test::Class #this, core::int value) → void {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|_injectedExtensionInstanceMethod(lowered final test::Class #this, core::int value) → void {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|get#_injectedExtensionInstanceMethod(lowered final test::Class #this) → (core::int) → void
+  return (core::int value) → void => test::Extension|_injectedExtensionInstanceMethod(#this, value);
+static extension-member get /* from org-dartlang-testcase:///patch_lib.dart */ Extension|_injectedExtensionStaticGetter() → core::int
+  return 42;
+static extension-member set /* from org-dartlang-testcase:///patch_lib.dart */ Extension|_injectedExtensionStaticSetter(core::int value) → void {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|_injectedExtensionStaticMethod(core::int value) → void {}
+
+constants  {
+  #C1 = static-tearoff test::topLevelMethod
+  #C2 = constructor-tearoff test::Class::•
+  #C3 = constructor-tearoff test::Class::redirecting
+  #C4 = constructor-tearoff test::Class::factory
+  #C5 = redirecting-factory-tearoff test::Class::redirectingFactory
+  #C6 = static-tearoff test::Class::staticMethod
+  #C7 = static-tearoff test::Extension|extensionStaticMethod
+  #C8 = _in::_Patch {}
+  #C9 = static-tearoff test::_injectedTopLevelMethod
+  #C10 = constructor-tearoff test::_InjectedClass::•
+  #C11 = constructor-tearoff test::_InjectedClass::redirecting
+  #C12 = constructor-tearoff test::_InjectedClass::factory
+  #C13 = redirecting-factory-tearoff test::_InjectedClass::redirectingFactory
+  #C14 = static-tearoff test::_InjectedClass::staticMethod
+  #C15 = constructor-tearoff test::Class::_injectedGenerative
+  #C16 = constructor-tearoff test::Class::_injectedRedirecting
+  #C17 = constructor-tearoff test::Class::_injectedFactory
+  #C18 = redirecting-factory-tearoff test::Class::_injectedRedirectingFactory
+  #C19 = static-tearoff test::Class::_injectedStaticMethod
+  #C20 = static-tearoff test::Extension|_injectedExtensionStaticMethod
+}
diff --git a/pkg/front_end/testcases/general/patching/main.dart.strong.outline.expect b/pkg/front_end/testcases/general/patching/main.dart.strong.outline.expect
new file mode 100644
index 0000000..1849018
--- /dev/null
+++ b/pkg/front_end/testcases/general/patching/main.dart.strong.outline.expect
@@ -0,0 +1,174 @@
+library;
+import self as self;
+
+import "dart:test";
+
+static method main() → dynamic
+  ;
+
+library;
+import self as self2;
+import "dart:_internal" as _in;
+import "dart:core" as core;
+
+import "dart:_internal";
+
+@/* from org-dartlang-testcase:///patch_lib.dart */ _in::patch
+class Class extends core::Object {
+  @_in::patch
+  external constructor •(core::int value) → self2::Class;
+  @_in::patch
+  external constructor redirecting(core::int value) → self2::Class;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _injectedGenerative(core::int value) → self2::Class
+    ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _injectedRedirecting(core::int value) → self2::Class
+    ;
+  @_in::patch
+  external static factory factory(core::int value) → self2::Class;
+  @_in::patch
+  external static factory redirectingFactory(core::int value) → self2::Class /* redirection-target: self2::Class::• */
+    return new self2::Class::•(value);
+  @_in::patch
+  external get instanceGetter() → core::int;
+  @_in::patch
+  external set instanceSetter(core::int value) → void;
+  @_in::patch
+  external method instanceMethod(core::int value) → void;
+  @_in::patch
+  external operator +(self2::Class a) → self2::Class;
+  @_in::patch
+  external static get staticGetter() → core::int;
+  @_in::patch
+  external static set staticSetter(core::int value) → void;
+  @_in::patch
+  external static method staticMethod(core::int value) → void;
+  static factory /* from org-dartlang-testcase:///patch_lib.dart */ _injectedFactory(core::int value) → self2::Class
+    ;
+  static factory /* from org-dartlang-testcase:///patch_lib.dart */ _injectedRedirectingFactory(core::int value) → self2::Class /* redirection-target: self2::Class::• */
+    return new self2::Class::•(value);
+  get /* from org-dartlang-testcase:///patch_lib.dart */ _injectedInstanceGetter() → core::int
+    ;
+  set /* from org-dartlang-testcase:///patch_lib.dart */ _injectedInstanceSetter(core::int value) → void
+    ;
+  method /* from org-dartlang-testcase:///patch_lib.dart */ _injectedInstanceMethod(core::int value) → void
+    ;
+  static get /* from org-dartlang-testcase:///patch_lib.dart */ _injectedStaticGetter() → core::int
+    ;
+  static set /* from org-dartlang-testcase:///patch_lib.dart */ _injectedStaticSetter(core::int value) → void
+    ;
+  static method /* from org-dartlang-testcase:///patch_lib.dart */ _injectedStaticMethod(core::int value) → void
+    ;
+}
+class _InjectedClass extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  field core::int instanceField;
+  static field core::int staticField;
+  constructor •(core::int value) → self2::_InjectedClass
+    ;
+  constructor redirecting(core::int value) → self2::_InjectedClass
+    ;
+  static factory factory(core::int value) → self2::_InjectedClass
+    ;
+  static factory redirectingFactory(core::int value) → self2::_InjectedClass /* redirection-target: self2::_InjectedClass::• */
+    return new self2::_InjectedClass::•(value);
+  get instanceGetter() → core::int
+    ;
+  set instanceSetter(core::int value) → void
+    ;
+  method instanceMethod(core::int value) → void
+    ;
+  static get staticGetter() → core::int
+    ;
+  static set staticSetter(core::int value) → void
+    ;
+  static method staticMethod(core::int value) → void
+    ;
+}
+@_in::patch
+extension Extension on self2::Class {
+  get extensionInstanceGetter = self2::Extension|get#extensionInstanceGetter;
+  method extensionInstanceMethod = self2::Extension|extensionInstanceMethod;
+  method tearoff extensionInstanceMethod = self2::Extension|get#extensionInstanceMethod;
+  operator - = self2::Extension|-;
+  static get extensionStaticGetter = get self2::Extension|extensionStaticGetter;
+  static method extensionStaticMethod = self2::Extension|extensionStaticMethod;
+  get _injectedExtensionInstanceGetter = self2::Extension|get#_injectedExtensionInstanceGetter;
+  method _injectedExtensionInstanceMethod = self2::Extension|_injectedExtensionInstanceMethod;
+  method tearoff _injectedExtensionInstanceMethod = self2::Extension|get#_injectedExtensionInstanceMethod;
+  static field _injectedExtensionStaticField = self2::Extension|_injectedExtensionStaticField;
+  static get _injectedExtensionStaticGetter = get self2::Extension|_injectedExtensionStaticGetter;
+  static method _injectedExtensionStaticMethod = self2::Extension|_injectedExtensionStaticMethod;
+  set extensionInstanceSetter = self2::Extension|set#extensionInstanceSetter;
+  static set extensionStaticSetter = set self2::Extension|extensionStaticSetter;
+  set _injectedExtensionInstanceSetter = self2::Extension|set#_injectedExtensionInstanceSetter;
+  static set _injectedExtensionStaticSetter = set self2::Extension|_injectedExtensionStaticSetter;
+}
+static field core::int Extension|_injectedExtensionStaticField /* from org-dartlang-testcase:///patch_lib.dart */;
+@_in::patch
+external static get topLevelGetter() → core::int;
+@_in::patch
+external static set topLevelSetter(core::int value) → void;
+@_in::patch
+external static method topLevelMethod(core::int value) → void;
+@_in::patch
+external static extension-member method Extension|get#extensionInstanceGetter(lowered final self2::Class #this) → core::int;
+@_in::patch
+external static extension-member method Extension|set#extensionInstanceSetter(lowered final self2::Class #this, core::int value) → void;
+@_in::patch
+external static extension-member method Extension|extensionInstanceMethod(lowered final self2::Class #this, core::int value) → void;
+static extension-member method Extension|get#extensionInstanceMethod(lowered final self2::Class #this) → (core::int) → void
+  return (core::int value) → void => self2::Extension|extensionInstanceMethod(#this, value);
+@_in::patch
+external static extension-member method Extension|-(lowered final self2::Class #this, self2::Class a) → self2::Class;
+@_in::patch
+external static extension-member get Extension|extensionStaticGetter() → core::int;
+@_in::patch
+external static extension-member set Extension|extensionStaticSetter(core::int value) → void;
+@_in::patch
+external static extension-member method Extension|extensionStaticMethod(core::int value) → void;
+static get /* from org-dartlang-testcase:///patch_lib.dart */ _injectedTopLevelGetter() → core::int
+  ;
+static set /* from org-dartlang-testcase:///patch_lib.dart */ _injectedTopLevelSetter(core::int value) → void
+  ;
+static method /* from org-dartlang-testcase:///patch_lib.dart */ _injectedTopLevelMethod(core::int value) → void
+  ;
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|get#_injectedExtensionInstanceGetter(lowered final self2::Class #this) → core::int
+  ;
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|set#_injectedExtensionInstanceSetter(lowered final self2::Class #this, core::int value) → void
+  ;
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|_injectedExtensionInstanceMethod(lowered final self2::Class #this, core::int value) → void
+  ;
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|get#_injectedExtensionInstanceMethod(lowered final self2::Class #this) → (core::int) → void
+  return (core::int value) → void => self2::Extension|_injectedExtensionInstanceMethod(#this, value);
+static extension-member get /* from org-dartlang-testcase:///patch_lib.dart */ Extension|_injectedExtensionStaticGetter() → core::int
+  ;
+static extension-member set /* from org-dartlang-testcase:///patch_lib.dart */ Extension|_injectedExtensionStaticSetter(core::int value) → void
+  ;
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|_injectedExtensionStaticMethod(core::int value) → void
+  ;
+
+
+Extra constant evaluation status:
+Evaluated: FileUriExpression @ org-dartlang-testcase:///patch_lib.dart:63:1 -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ org-dartlang-testcase:///origin_lib.dart:7:29 -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ org-dartlang-testcase:///origin_lib.dart:12:5 -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ org-dartlang-testcase:///origin_lib.dart:16:27 -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Evaluated: StaticGet @ (unknown position in org-dartlang-testcase:///origin_lib.dart) -> InstanceConstant(const _Patch{})
+Extra constant evaluation: evaluated: 37, effectively constant: 23
diff --git a/pkg/front_end/testcases/general/patching/main.dart.strong.transformed.expect b/pkg/front_end/testcases/general/patching/main.dart.strong.transformed.expect
new file mode 100644
index 0000000..62bfec3
--- /dev/null
+++ b/pkg/front_end/testcases/general/patching/main.dart.strong.transformed.expect
@@ -0,0 +1,238 @@
+library;
+import self as self;
+import "dart:test" as test;
+import "dart:core" as core;
+
+import "dart:test";
+
+static method main() → dynamic {
+  test::topLevelSetter = test::topLevelGetter;
+  test::topLevelMethod(42);
+  #C1;
+  test::Class c = new test::Class::•(42);
+  #C2;
+  new test::Class::redirecting(42);
+  #C3;
+  test::Class::factory(42);
+  #C4;
+  new test::Class::•(42);
+  #C5;
+  c.{test::Class::instanceSetter} = c.{test::Class::instanceGetter}{core::int};
+  c.{test::Class::instanceMethod}(42){(core::int) → void};
+  c.{test::Class::instanceMethod}{(core::int) → void};
+  c.{test::Class::+}(c){(test::Class) → test::Class};
+  test::Class::staticSetter = test::Class::staticGetter;
+  test::Class::staticMethod(42);
+  #C6;
+  test::Extension|set#extensionInstanceSetter(c, test::Extension|get#extensionInstanceGetter(c));
+  test::Extension|extensionInstanceMethod(c, 42);
+  test::Extension|get#extensionInstanceMethod(c);
+  test::Extension|-(c, c);
+  test::Extension|extensionStaticSetter = test::Extension|extensionStaticGetter;
+  test::Extension|extensionStaticMethod(42);
+  #C7;
+}
+
+library;
+import self as test;
+import "dart:_internal" as _in;
+import "dart:core" as core;
+
+import "dart:_internal";
+
+@/* from org-dartlang-testcase:///patch_lib.dart */ #C8
+class Class extends core::Object {
+  @#C8
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ •(core::int value) → test::Class
+    : super core::Object::•()
+    ;
+  @#C8
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ redirecting(core::int value) → test::Class
+    : this test::Class::•(value)
+    ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _injectedGenerative(core::int value) → test::Class
+    : super core::Object::•()
+    ;
+  constructor /* from org-dartlang-testcase:///patch_lib.dart */ _injectedRedirecting(core::int value) → test::Class
+    : this test::Class::•(value)
+    ;
+  @#C8
+  static factory /* from org-dartlang-testcase:///patch_lib.dart */ factory(core::int value) → test::Class
+    return new test::Class::•(value);
+  @#C8
+  static factory /* from org-dartlang-testcase:///patch_lib.dart */ redirectingFactory(core::int value) → test::Class /* redirection-target: test::Class::• */
+    return new test::Class::•(value);
+  @#C8
+  get /* from org-dartlang-testcase:///patch_lib.dart */ instanceGetter() → core::int
+    return 42;
+  @#C8
+  set /* from org-dartlang-testcase:///patch_lib.dart */ instanceSetter(core::int value) → void {}
+  @#C8
+  method /* from org-dartlang-testcase:///patch_lib.dart */ instanceMethod(core::int value) → void {}
+  @#C8
+  operator /* from org-dartlang-testcase:///patch_lib.dart */ +(test::Class a) → test::Class
+    return this;
+  @#C8
+  static get /* from org-dartlang-testcase:///patch_lib.dart */ staticGetter() → core::int
+    return 42;
+  @#C8
+  static set /* from org-dartlang-testcase:///patch_lib.dart */ staticSetter(core::int value) → void {}
+  @#C8
+  static method /* from org-dartlang-testcase:///patch_lib.dart */ staticMethod(core::int value) → void {}
+  static factory /* from org-dartlang-testcase:///patch_lib.dart */ _injectedFactory(core::int value) → test::Class
+    return new test::Class::•(value);
+  static factory /* from org-dartlang-testcase:///patch_lib.dart */ _injectedRedirectingFactory(core::int value) → test::Class /* redirection-target: test::Class::• */
+    return new test::Class::•(value);
+  get /* from org-dartlang-testcase:///patch_lib.dart */ _injectedInstanceGetter() → core::int
+    return 42;
+  set /* from org-dartlang-testcase:///patch_lib.dart */ _injectedInstanceSetter(core::int value) → void {}
+  method /* from org-dartlang-testcase:///patch_lib.dart */ _injectedInstanceMethod(core::int value) → void {}
+  static get /* from org-dartlang-testcase:///patch_lib.dart */ _injectedStaticGetter() → core::int
+    return 42;
+  static set /* from org-dartlang-testcase:///patch_lib.dart */ _injectedStaticSetter(core::int value) → void {}
+  static method /* from org-dartlang-testcase:///patch_lib.dart */ _injectedStaticMethod(core::int value) → void {}
+}
+class _InjectedClass extends core::Object { // from org-dartlang-testcase:///patch_lib.dart
+  field core::int instanceField = 42;
+  static field core::int staticField = 42;
+  constructor •(core::int value) → test::_InjectedClass
+    : super core::Object::•()
+    ;
+  constructor redirecting(core::int value) → test::_InjectedClass
+    : this test::_InjectedClass::•(value)
+    ;
+  static factory factory(core::int value) → test::_InjectedClass
+    return new test::_InjectedClass::•(value);
+  static factory redirectingFactory(core::int value) → test::_InjectedClass /* redirection-target: test::_InjectedClass::• */
+    return new test::_InjectedClass::•(value);
+  get instanceGetter() → core::int
+    return 42;
+  set instanceSetter(core::int value) → void {}
+  method instanceMethod(core::int value) → void {}
+  static get staticGetter() → core::int
+    return 42;
+  static set staticSetter(core::int value) → void {}
+  static method staticMethod(core::int value) → void {}
+}
+@#C8
+extension Extension on test::Class {
+  get extensionInstanceGetter = test::Extension|get#extensionInstanceGetter;
+  method extensionInstanceMethod = test::Extension|extensionInstanceMethod;
+  method tearoff extensionInstanceMethod = test::Extension|get#extensionInstanceMethod;
+  operator - = test::Extension|-;
+  static get extensionStaticGetter = get test::Extension|extensionStaticGetter;
+  static method extensionStaticMethod = test::Extension|extensionStaticMethod;
+  get _injectedExtensionInstanceGetter = test::Extension|get#_injectedExtensionInstanceGetter;
+  method _injectedExtensionInstanceMethod = test::Extension|_injectedExtensionInstanceMethod;
+  method tearoff _injectedExtensionInstanceMethod = test::Extension|get#_injectedExtensionInstanceMethod;
+  static field _injectedExtensionStaticField = test::Extension|_injectedExtensionStaticField;
+  static get _injectedExtensionStaticGetter = get test::Extension|_injectedExtensionStaticGetter;
+  static method _injectedExtensionStaticMethod = test::Extension|_injectedExtensionStaticMethod;
+  set extensionInstanceSetter = test::Extension|set#extensionInstanceSetter;
+  static set extensionStaticSetter = set test::Extension|extensionStaticSetter;
+  set _injectedExtensionInstanceSetter = test::Extension|set#_injectedExtensionInstanceSetter;
+  static set _injectedExtensionStaticSetter = set test::Extension|_injectedExtensionStaticSetter;
+}
+static field core::int Extension|_injectedExtensionStaticField = 42 /* from org-dartlang-testcase:///patch_lib.dart */;
+@#C8
+static get /* from org-dartlang-testcase:///patch_lib.dart */ topLevelGetter() → core::int
+  return 42;
+@#C8
+static set /* from org-dartlang-testcase:///patch_lib.dart */ topLevelSetter(core::int value) → void {}
+@#C8
+static method /* from org-dartlang-testcase:///patch_lib.dart */ topLevelMethod(core::int value) → void {}
+@#C8
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|get#extensionInstanceGetter(lowered final test::Class #this) → core::int
+  return 42;
+@#C8
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|set#extensionInstanceSetter(lowered final test::Class #this, core::int value) → void {}
+@#C8
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|extensionInstanceMethod(lowered final test::Class #this, core::int value) → void {}
+static extension-member method Extension|get#extensionInstanceMethod(lowered final test::Class #this) → (core::int) → void
+  return (core::int value) → void => test::Extension|extensionInstanceMethod(#this, value);
+@#C8
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|-(lowered final test::Class #this, test::Class a) → test::Class
+  return #this;
+@#C8
+static extension-member get /* from org-dartlang-testcase:///patch_lib.dart */ Extension|extensionStaticGetter() → core::int
+  return 42;
+@#C8
+static extension-member set /* from org-dartlang-testcase:///patch_lib.dart */ Extension|extensionStaticSetter(core::int value) → void {}
+@#C8
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|extensionStaticMethod(core::int value) → void {}
+static get /* from org-dartlang-testcase:///patch_lib.dart */ _injectedTopLevelGetter() → core::int
+  return 42;
+static set /* from org-dartlang-testcase:///patch_lib.dart */ _injectedTopLevelSetter(core::int value) → void {}
+static method /* from org-dartlang-testcase:///patch_lib.dart */ _injectedTopLevelMethod(core::int value) → void {
+  test::_injectedTopLevelSetter = test::_injectedTopLevelGetter;
+  test::_injectedTopLevelMethod(42);
+  #C9;
+  test::_InjectedClass i = new test::_InjectedClass::•(42);
+  #C10;
+  new test::_InjectedClass::redirecting(42);
+  #C11;
+  test::_InjectedClass::factory(42);
+  #C12;
+  new test::_InjectedClass::•(42);
+  #C13;
+  i.{test::_InjectedClass::instanceSetter} = i.{test::_InjectedClass::instanceGetter}{core::int};
+  i.{test::_InjectedClass::instanceMethod}(42){(core::int) → void};
+  i.{test::_InjectedClass::instanceMethod}{(core::int) → void};
+  test::_InjectedClass::staticSetter = test::_InjectedClass::staticGetter;
+  test::_InjectedClass::staticMethod(42);
+  #C14;
+  test::Class c = new test::Class::•(42);
+  new test::Class::_injectedGenerative(42);
+  #C15;
+  new test::Class::_injectedRedirecting(42);
+  #C16;
+  test::Class::_injectedFactory(42);
+  #C17;
+  new test::Class::•(42);
+  #C18;
+  c.{test::Class::_injectedInstanceSetter} = c.{test::Class::_injectedInstanceGetter}{core::int};
+  c.{test::Class::_injectedInstanceMethod}(42){(core::int) → void};
+  c.{test::Class::_injectedInstanceMethod}{(core::int) → void};
+  test::Class::_injectedStaticSetter = test::Class::_injectedStaticGetter;
+  test::Class::_injectedStaticMethod(42);
+  #C19;
+  test::Extension|set#_injectedExtensionInstanceSetter(c, test::Extension|get#_injectedExtensionInstanceGetter(c));
+  test::Extension|_injectedExtensionInstanceMethod(c, 42);
+  test::Extension|get#_injectedExtensionInstanceMethod(c);
+  test::Extension|_injectedExtensionStaticSetter = test::Extension|_injectedExtensionStaticGetter;
+  test::Extension|_injectedExtensionStaticMethod(42);
+  #C20;
+}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|get#_injectedExtensionInstanceGetter(lowered final test::Class #this) → core::int
+  return 42;
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|set#_injectedExtensionInstanceSetter(lowered final test::Class #this, core::int value) → void {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|_injectedExtensionInstanceMethod(lowered final test::Class #this, core::int value) → void {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|get#_injectedExtensionInstanceMethod(lowered final test::Class #this) → (core::int) → void
+  return (core::int value) → void => test::Extension|_injectedExtensionInstanceMethod(#this, value);
+static extension-member get /* from org-dartlang-testcase:///patch_lib.dart */ Extension|_injectedExtensionStaticGetter() → core::int
+  return 42;
+static extension-member set /* from org-dartlang-testcase:///patch_lib.dart */ Extension|_injectedExtensionStaticSetter(core::int value) → void {}
+static extension-member method /* from org-dartlang-testcase:///patch_lib.dart */ Extension|_injectedExtensionStaticMethod(core::int value) → void {}
+
+constants  {
+  #C1 = static-tearoff test::topLevelMethod
+  #C2 = constructor-tearoff test::Class::•
+  #C3 = constructor-tearoff test::Class::redirecting
+  #C4 = constructor-tearoff test::Class::factory
+  #C5 = redirecting-factory-tearoff test::Class::redirectingFactory
+  #C6 = static-tearoff test::Class::staticMethod
+  #C7 = static-tearoff test::Extension|extensionStaticMethod
+  #C8 = _in::_Patch {}
+  #C9 = static-tearoff test::_injectedTopLevelMethod
+  #C10 = constructor-tearoff test::_InjectedClass::•
+  #C11 = constructor-tearoff test::_InjectedClass::redirecting
+  #C12 = constructor-tearoff test::_InjectedClass::factory
+  #C13 = redirecting-factory-tearoff test::_InjectedClass::redirectingFactory
+  #C14 = static-tearoff test::_InjectedClass::staticMethod
+  #C15 = constructor-tearoff test::Class::_injectedGenerative
+  #C16 = constructor-tearoff test::Class::_injectedRedirecting
+  #C17 = constructor-tearoff test::Class::_injectedFactory
+  #C18 = redirecting-factory-tearoff test::Class::_injectedRedirectingFactory
+  #C19 = static-tearoff test::Class::_injectedStaticMethod
+  #C20 = static-tearoff test::Extension|_injectedExtensionStaticMethod
+}
diff --git a/pkg/front_end/testcases/general/patching/main.dart.textual_outline.expect b/pkg/front_end/testcases/general/patching/main.dart.textual_outline.expect
new file mode 100644
index 0000000..3c9c90e
--- /dev/null
+++ b/pkg/front_end/testcases/general/patching/main.dart.textual_outline.expect
@@ -0,0 +1,3 @@
+import 'dart:test';
+
+main() {}
diff --git a/pkg/front_end/testcases/general/patching/main.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/general/patching/main.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..3c9c90e
--- /dev/null
+++ b/pkg/front_end/testcases/general/patching/main.dart.textual_outline_modelled.expect
@@ -0,0 +1,3 @@
+import 'dart:test';
+
+main() {}
diff --git a/pkg/front_end/testcases/general/patching/origin_lib.dart b/pkg/front_end/testcases/general/patching/origin_lib.dart
new file mode 100644
index 0000000..dadf932
--- /dev/null
+++ b/pkg/front_end/testcases/general/patching/origin_lib.dart
@@ -0,0 +1,49 @@
+// Copyright (c) 2025, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+external int get topLevelGetter;
+
+external void set topLevelSetter(int value);
+
+external void topLevelMethod(int value);
+
+class Class {
+  external Class(int value);
+
+  external Class.redirecting(int value);
+
+  external factory Class.factory(int value);
+
+  external factory Class.redirectingFactory(int value);
+
+  external int get instanceGetter;
+
+  external void set instanceSetter(int value);
+
+  external void instanceMethod(int value);
+
+  external Class operator +(Class a);
+
+  external static int get staticGetter;
+
+  external static void set staticSetter(int value);
+
+  external static void staticMethod(int value);
+}
+
+extension Extension on Class {
+  external int get extensionInstanceGetter;
+
+  external void set extensionInstanceSetter(int value);
+
+  external void extensionInstanceMethod(int value);
+
+  external Class operator -(Class a);
+
+  external static int get extensionStaticGetter;
+
+  external static void set extensionStaticSetter(int value);
+
+  external static void extensionStaticMethod(int value);
+}
diff --git a/pkg/front_end/testcases/general/patching/patch_lib.dart b/pkg/front_end/testcases/general/patching/patch_lib.dart
new file mode 100644
index 0000000..4879ab1
--- /dev/null
+++ b/pkg/front_end/testcases/general/patching/patch_lib.dart
@@ -0,0 +1,170 @@
+// Copyright (c) 2025, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// ignore: import_internal_library
+import 'dart:_internal';
+
+@patch
+int get topLevelGetter => 42;
+
+int get _injectedTopLevelGetter => 42;
+
+@patch
+void set topLevelSetter(int value) {}
+
+void set _injectedTopLevelSetter(int value) {}
+
+@patch
+void topLevelMethod(int value) {}
+
+void _injectedTopLevelMethod(int value) {
+  _injectedTopLevelSetter = _injectedTopLevelGetter;
+  _injectedTopLevelMethod(42);
+  _injectedTopLevelMethod;
+  var i = _InjectedClass(42);
+  _InjectedClass.new;
+  _InjectedClass.redirecting(42);
+  _InjectedClass.redirecting;
+  _InjectedClass.factory(42);
+  _InjectedClass.factory;
+  _InjectedClass.redirectingFactory(42);
+  _InjectedClass.redirectingFactory;
+  i.instanceSetter = i.instanceGetter;
+  i.instanceMethod(42);
+  i.instanceMethod;
+  _InjectedClass.staticSetter = _InjectedClass.staticGetter;
+  _InjectedClass.staticMethod(42);
+  _InjectedClass.staticMethod;
+  var c = Class(42);
+  Class._injectedGenerative(42);
+  Class._injectedGenerative;
+  Class._injectedRedirecting(42);
+  Class._injectedRedirecting;
+  Class._injectedFactory(42);
+  Class._injectedFactory;
+  Class._injectedRedirectingFactory(42);
+  Class._injectedRedirectingFactory;
+  c._injectedInstanceSetter = c._injectedInstanceGetter;
+  c._injectedInstanceMethod(42);
+  c._injectedInstanceMethod;
+  Class._injectedStaticSetter = Class._injectedStaticGetter;
+  Class._injectedStaticMethod(42);
+  Class._injectedStaticMethod;
+  c._injectedExtensionInstanceSetter = c._injectedExtensionInstanceGetter;
+  c._injectedExtensionInstanceMethod(42);
+  c._injectedExtensionInstanceMethod;
+  Extension._injectedExtensionStaticSetter =
+      Extension._injectedExtensionStaticGetter;
+  Extension._injectedExtensionStaticMethod(42);
+  Extension._injectedExtensionStaticMethod;
+}
+
+@patch
+class Class {
+  @patch
+  Class(int value);
+
+  Class._injectedGenerative(int value);
+
+  @patch
+  Class.redirecting(int value) : this(value);
+
+  Class._injectedRedirecting(int value) : this(value);
+
+  @patch
+  factory Class.factory(int value) => Class(value);
+
+  factory Class._injectedFactory(int value) => Class(value);
+
+  @patch
+  factory Class.redirectingFactory(int value) = Class;
+
+  factory Class._injectedRedirectingFactory(int value) = Class;
+
+  @patch
+  int get instanceGetter => 42;
+
+  int get _injectedInstanceGetter => 42;
+
+  @patch
+  void set instanceSetter(int value) {}
+
+  void set _injectedInstanceSetter(int value) {}
+
+  @patch
+  void instanceMethod(int value) {}
+
+  void _injectedInstanceMethod(int value) {}
+
+  @patch
+  Class operator +(Class a) => this;
+
+  @patch
+  static int get staticGetter => 42;
+
+  static int get _injectedStaticGetter => 42;
+
+  @patch
+  static void set staticSetter(int value) {}
+
+  static void set _injectedStaticSetter(int value) {}
+
+  @patch
+  static void staticMethod(int value) {}
+
+  static void _injectedStaticMethod(int value) {}
+}
+
+class _InjectedClass {
+  _InjectedClass(int value);
+  _InjectedClass.redirecting(int value) : this(value);
+  factory _InjectedClass.factory(int value) => _InjectedClass(value);
+  factory _InjectedClass.redirectingFactory(int value) = _InjectedClass;
+  int instanceField = 42;
+  int get instanceGetter => 42;
+  void set instanceSetter(int value) {}
+  void instanceMethod(int value) {}
+  static int staticField = 42;
+  static int get staticGetter => 42;
+  static void set staticSetter(int value) {}
+  static void staticMethod(int value) {}
+}
+
+@patch
+extension Extension on Class {
+  @patch
+  int get extensionInstanceGetter => 42;
+
+  int get _injectedExtensionInstanceGetter => 42;
+
+  @patch
+  void set extensionInstanceSetter(int value) {}
+
+  void set _injectedExtensionInstanceSetter(int value) {}
+
+  @patch
+  void extensionInstanceMethod(int value) {}
+
+  void _injectedExtensionInstanceMethod(int value) {}
+
+  @patch
+  Class operator -(Class a) => this;
+
+  static int _injectedExtensionStaticField = 42;
+
+  @patch
+  static int get extensionStaticGetter => 42;
+
+  static int get _injectedExtensionStaticGetter => 42;
+
+  @patch
+  static void set extensionStaticSetter(int value) {}
+
+  static void set _injectedExtensionStaticSetter(int value) {}
+
+  @patch
+  static void extensionStaticMethod(int value) {}
+
+  static void _injectedExtensionStaticMethod(int value) {}
+}
diff --git a/pkg/front_end/testcases/general/platform_invalid_uris/main.dart.strong.expect b/pkg/front_end/testcases/general/platform_invalid_uris/main.dart.strong.expect
index e7c7541..73ddd2f 100644
--- a/pkg/front_end/testcases/general/platform_invalid_uris/main.dart.strong.expect
+++ b/pkg/front_end/testcases/general/platform_invalid_uris/main.dart.strong.expect
@@ -52,11 +52,11 @@
 import "dart:_internal" as _in;
 import "dart:core" as core;
 
+import "org-dartlang-malformed-uri:?%3Aa";
+export "org-dartlang-malformed-uri:?%3Ab";
 import "dart:_internal";
 import "org-dartlang-malformed-uri:?%3Ac";
 export "org-dartlang-malformed-uri:?%3Ad";
-import "org-dartlang-malformed-uri:?%3Aa";
-export "org-dartlang-malformed-uri:?%3Ab";
 
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C1
 class Class extends core::Object {
diff --git a/pkg/front_end/testcases/general/platform_invalid_uris/main.dart.strong.modular.expect b/pkg/front_end/testcases/general/platform_invalid_uris/main.dart.strong.modular.expect
index e7c7541..73ddd2f 100644
--- a/pkg/front_end/testcases/general/platform_invalid_uris/main.dart.strong.modular.expect
+++ b/pkg/front_end/testcases/general/platform_invalid_uris/main.dart.strong.modular.expect
@@ -52,11 +52,11 @@
 import "dart:_internal" as _in;
 import "dart:core" as core;
 
+import "org-dartlang-malformed-uri:?%3Aa";
+export "org-dartlang-malformed-uri:?%3Ab";
 import "dart:_internal";
 import "org-dartlang-malformed-uri:?%3Ac";
 export "org-dartlang-malformed-uri:?%3Ad";
-import "org-dartlang-malformed-uri:?%3Aa";
-export "org-dartlang-malformed-uri:?%3Ab";
 
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C1
 class Class extends core::Object {
diff --git a/pkg/front_end/testcases/general/platform_invalid_uris/main.dart.strong.outline.expect b/pkg/front_end/testcases/general/platform_invalid_uris/main.dart.strong.outline.expect
index 36864cd..8533509 100644
--- a/pkg/front_end/testcases/general/platform_invalid_uris/main.dart.strong.outline.expect
+++ b/pkg/front_end/testcases/general/platform_invalid_uris/main.dart.strong.outline.expect
@@ -50,11 +50,11 @@
 import "dart:_internal" as _in;
 import "dart:core" as core;
 
+import "org-dartlang-malformed-uri:?%3Aa";
+export "org-dartlang-malformed-uri:?%3Ab";
 import "dart:_internal";
 import "org-dartlang-malformed-uri:?%3Ac";
 export "org-dartlang-malformed-uri:?%3Ad";
-import "org-dartlang-malformed-uri:?%3Aa";
-export "org-dartlang-malformed-uri:?%3Ab";
 
 @/* from org-dartlang-testcase:///patch_lib.dart */ _in::patch
 class Class extends core::Object {
diff --git a/pkg/front_end/testcases/general/platform_invalid_uris/main.dart.strong.transformed.expect b/pkg/front_end/testcases/general/platform_invalid_uris/main.dart.strong.transformed.expect
index e7c7541..73ddd2f 100644
--- a/pkg/front_end/testcases/general/platform_invalid_uris/main.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/platform_invalid_uris/main.dart.strong.transformed.expect
@@ -52,11 +52,11 @@
 import "dart:_internal" as _in;
 import "dart:core" as core;
 
+import "org-dartlang-malformed-uri:?%3Aa";
+export "org-dartlang-malformed-uri:?%3Ab";
 import "dart:_internal";
 import "org-dartlang-malformed-uri:?%3Ac";
 export "org-dartlang-malformed-uri:?%3Ad";
-import "org-dartlang-malformed-uri:?%3Aa";
-export "org-dartlang-malformed-uri:?%3Ab";
 
 @/* from org-dartlang-testcase:///patch_lib.dart */ #C1
 class Class extends core::Object {
diff --git a/pkg/front_end/testcases/nnbd/platform_definite_assignment/main.dart.strong.expect b/pkg/front_end/testcases/nnbd/platform_definite_assignment/main.dart.strong.expect
index 982632b..8639a1e 100644
--- a/pkg/front_end/testcases/nnbd/platform_definite_assignment/main.dart.strong.expect
+++ b/pkg/front_end/testcases/nnbd/platform_definite_assignment/main.dart.strong.expect
@@ -13,6 +13,18 @@
 //
 // Problems in library:
 //
+// pkg/front_end/testcases/nnbd/platform_definite_assignment/origin_lib.dart:17:5: Error: Non-nullable variable 'k' must be assigned before it can be used.
+//     k;
+//     ^
+//
+// pkg/front_end/testcases/nnbd/platform_definite_assignment/origin_lib.dart:25:12: Error: Non-nullable variable 'k' must be assigned before it can be used.
+//     return k;
+//            ^
+//
+// pkg/front_end/testcases/nnbd/platform_definite_assignment/origin_lib.dart:34:10: Error: Non-nullable variable 'k' must be assigned before it can be used.
+//   return k;
+//          ^
+//
 // pkg/front_end/testcases/nnbd/platform_definite_assignment/patch_lib.dart:15:5: Error: Non-nullable variable 'k' must be assigned before it can be used.
 //     k;
 //     ^
@@ -33,18 +45,6 @@
 //   return k;
 //          ^
 //
-// pkg/front_end/testcases/nnbd/platform_definite_assignment/origin_lib.dart:17:5: Error: Non-nullable variable 'k' must be assigned before it can be used.
-//     k;
-//     ^
-//
-// pkg/front_end/testcases/nnbd/platform_definite_assignment/origin_lib.dart:25:12: Error: Non-nullable variable 'k' must be assigned before it can be used.
-//     return k;
-//            ^
-//
-// pkg/front_end/testcases/nnbd/platform_definite_assignment/origin_lib.dart:34:10: Error: Non-nullable variable 'k' must be assigned before it can be used.
-//   return k;
-//          ^
-//
 import self as test;
 import "dart:_internal" as _in;
 import "dart:core" as core;
diff --git a/pkg/front_end/testcases/nnbd/platform_definite_assignment/main.dart.strong.modular.expect b/pkg/front_end/testcases/nnbd/platform_definite_assignment/main.dart.strong.modular.expect
index 982632b..8639a1e 100644
--- a/pkg/front_end/testcases/nnbd/platform_definite_assignment/main.dart.strong.modular.expect
+++ b/pkg/front_end/testcases/nnbd/platform_definite_assignment/main.dart.strong.modular.expect
@@ -13,6 +13,18 @@
 //
 // Problems in library:
 //
+// pkg/front_end/testcases/nnbd/platform_definite_assignment/origin_lib.dart:17:5: Error: Non-nullable variable 'k' must be assigned before it can be used.
+//     k;
+//     ^
+//
+// pkg/front_end/testcases/nnbd/platform_definite_assignment/origin_lib.dart:25:12: Error: Non-nullable variable 'k' must be assigned before it can be used.
+//     return k;
+//            ^
+//
+// pkg/front_end/testcases/nnbd/platform_definite_assignment/origin_lib.dart:34:10: Error: Non-nullable variable 'k' must be assigned before it can be used.
+//   return k;
+//          ^
+//
 // pkg/front_end/testcases/nnbd/platform_definite_assignment/patch_lib.dart:15:5: Error: Non-nullable variable 'k' must be assigned before it can be used.
 //     k;
 //     ^
@@ -33,18 +45,6 @@
 //   return k;
 //          ^
 //
-// pkg/front_end/testcases/nnbd/platform_definite_assignment/origin_lib.dart:17:5: Error: Non-nullable variable 'k' must be assigned before it can be used.
-//     k;
-//     ^
-//
-// pkg/front_end/testcases/nnbd/platform_definite_assignment/origin_lib.dart:25:12: Error: Non-nullable variable 'k' must be assigned before it can be used.
-//     return k;
-//            ^
-//
-// pkg/front_end/testcases/nnbd/platform_definite_assignment/origin_lib.dart:34:10: Error: Non-nullable variable 'k' must be assigned before it can be used.
-//   return k;
-//          ^
-//
 import self as test;
 import "dart:_internal" as _in;
 import "dart:core" as core;
diff --git a/pkg/front_end/testcases/nnbd/platform_definite_assignment/main.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/platform_definite_assignment/main.dart.strong.transformed.expect
index 982632b..8639a1e 100644
--- a/pkg/front_end/testcases/nnbd/platform_definite_assignment/main.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/platform_definite_assignment/main.dart.strong.transformed.expect
@@ -13,6 +13,18 @@
 //
 // Problems in library:
 //
+// pkg/front_end/testcases/nnbd/platform_definite_assignment/origin_lib.dart:17:5: Error: Non-nullable variable 'k' must be assigned before it can be used.
+//     k;
+//     ^
+//
+// pkg/front_end/testcases/nnbd/platform_definite_assignment/origin_lib.dart:25:12: Error: Non-nullable variable 'k' must be assigned before it can be used.
+//     return k;
+//            ^
+//
+// pkg/front_end/testcases/nnbd/platform_definite_assignment/origin_lib.dart:34:10: Error: Non-nullable variable 'k' must be assigned before it can be used.
+//   return k;
+//          ^
+//
 // pkg/front_end/testcases/nnbd/platform_definite_assignment/patch_lib.dart:15:5: Error: Non-nullable variable 'k' must be assigned before it can be used.
 //     k;
 //     ^
@@ -33,18 +45,6 @@
 //   return k;
 //          ^
 //
-// pkg/front_end/testcases/nnbd/platform_definite_assignment/origin_lib.dart:17:5: Error: Non-nullable variable 'k' must be assigned before it can be used.
-//     k;
-//     ^
-//
-// pkg/front_end/testcases/nnbd/platform_definite_assignment/origin_lib.dart:25:12: Error: Non-nullable variable 'k' must be assigned before it can be used.
-//     return k;
-//            ^
-//
-// pkg/front_end/testcases/nnbd/platform_definite_assignment/origin_lib.dart:34:10: Error: Non-nullable variable 'k' must be assigned before it can be used.
-//   return k;
-//          ^
-//
 import self as test;
 import "dart:_internal" as _in;
 import "dart:core" as core;
diff --git a/pkg/front_end/testcases/nnbd/platform_nonnullable_fields/libraries.json b/pkg/front_end/testcases/nnbd/platform_nonnullable_fields/libraries.json
index f89ef7f..79373ad 100644
--- a/pkg/front_end/testcases/nnbd/platform_nonnullable_fields/libraries.json
+++ b/pkg/front_end/testcases/nnbd/platform_nonnullable_fields/libraries.json
@@ -4,8 +4,7 @@
     "libraries": {
       "test": {
         "patches": [
-          "patch_lib.dart",
-          "patch_lib2.dart"
+          "patch_lib.dart"
         ],
         "uri": "origin_lib.dart"
       }
diff --git a/pkg/front_end/testcases/nnbd/platform_nonnullable_fields/main.dart.strong.expect b/pkg/front_end/testcases/nnbd/platform_nonnullable_fields/main.dart.strong.expect
index c61d853..3ef6b9e 100644
--- a/pkg/front_end/testcases/nnbd/platform_nonnullable_fields/main.dart.strong.expect
+++ b/pkg/front_end/testcases/nnbd/platform_nonnullable_fields/main.dart.strong.expect
@@ -46,12 +46,12 @@
 @/* from org-dartlang-testcase:///patch_lib2.dart */ #C1
 class Class2 extends core::Object {
   field core::int _field /* from org-dartlang-testcase:///patch_lib2.dart */;
-  constructor /* from org-dartlang-testcase:///patch_lib2.dart */ constructor2(core::int _field) → test::Class2
-    : test::Class2::_field = _field, super core::Object::•()
-    ;
   constructor constructor1() → test::Class2
     : test::Class2::_field = null, super core::Object::•()
     ;
+  constructor /* from org-dartlang-testcase:///patch_lib2.dart */ constructor2(core::int _field) → test::Class2
+    : test::Class2::_field = _field, super core::Object::•()
+    ;
 }
 
 constants  {
diff --git a/pkg/front_end/testcases/nnbd/platform_nonnullable_fields/main.dart.strong.modular.expect b/pkg/front_end/testcases/nnbd/platform_nonnullable_fields/main.dart.strong.modular.expect
index c61d853..3ef6b9e 100644
--- a/pkg/front_end/testcases/nnbd/platform_nonnullable_fields/main.dart.strong.modular.expect
+++ b/pkg/front_end/testcases/nnbd/platform_nonnullable_fields/main.dart.strong.modular.expect
@@ -46,12 +46,12 @@
 @/* from org-dartlang-testcase:///patch_lib2.dart */ #C1
 class Class2 extends core::Object {
   field core::int _field /* from org-dartlang-testcase:///patch_lib2.dart */;
-  constructor /* from org-dartlang-testcase:///patch_lib2.dart */ constructor2(core::int _field) → test::Class2
-    : test::Class2::_field = _field, super core::Object::•()
-    ;
   constructor constructor1() → test::Class2
     : test::Class2::_field = null, super core::Object::•()
     ;
+  constructor /* from org-dartlang-testcase:///patch_lib2.dart */ constructor2(core::int _field) → test::Class2
+    : test::Class2::_field = _field, super core::Object::•()
+    ;
 }
 
 constants  {
diff --git a/pkg/front_end/testcases/nnbd/platform_nonnullable_fields/main.dart.strong.outline.expect b/pkg/front_end/testcases/nnbd/platform_nonnullable_fields/main.dart.strong.outline.expect
index f46b90b..0b96489 100644
--- a/pkg/front_end/testcases/nnbd/platform_nonnullable_fields/main.dart.strong.outline.expect
+++ b/pkg/front_end/testcases/nnbd/platform_nonnullable_fields/main.dart.strong.outline.expect
@@ -31,10 +31,10 @@
 @/* from org-dartlang-testcase:///patch_lib2.dart */ _in::patch
 class Class2 extends core::Object {
   field core::int _field /* from org-dartlang-testcase:///patch_lib2.dart */;
-  constructor /* from org-dartlang-testcase:///patch_lib2.dart */ constructor2(core::int _field) → self2::Class2
-    ;
   constructor constructor1() → self2::Class2
     ;
+  constructor /* from org-dartlang-testcase:///patch_lib2.dart */ constructor2(core::int _field) → self2::Class2
+    ;
 }
 
 
diff --git a/pkg/front_end/testcases/nnbd/platform_nonnullable_fields/main.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/platform_nonnullable_fields/main.dart.strong.transformed.expect
index c61d853..3ef6b9e 100644
--- a/pkg/front_end/testcases/nnbd/platform_nonnullable_fields/main.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/platform_nonnullable_fields/main.dart.strong.transformed.expect
@@ -46,12 +46,12 @@
 @/* from org-dartlang-testcase:///patch_lib2.dart */ #C1
 class Class2 extends core::Object {
   field core::int _field /* from org-dartlang-testcase:///patch_lib2.dart */;
-  constructor /* from org-dartlang-testcase:///patch_lib2.dart */ constructor2(core::int _field) → test::Class2
-    : test::Class2::_field = _field, super core::Object::•()
-    ;
   constructor constructor1() → test::Class2
     : test::Class2::_field = null, super core::Object::•()
     ;
+  constructor /* from org-dartlang-testcase:///patch_lib2.dart */ constructor2(core::int _field) → test::Class2
+    : test::Class2::_field = _field, super core::Object::•()
+    ;
 }
 
 constants  {
diff --git a/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.strong.expect b/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.strong.expect
index ab03b8e..b798b46 100644
--- a/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.strong.expect
+++ b/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.strong.expect
@@ -22,16 +22,6 @@
 //   void patchedMethod([int i]) {}
 //                           ^
 //
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:17:25: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
-// Try adding either an explicit non-'null' default value or the 'required' modifier.
-// void patchedMethod([int i]) {}
-//                         ^
-//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:19:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
-// Try adding either an explicit non-'null' default value or the 'required' modifier.
-// void _injectedMethod([int i]) {}
-//                           ^
-//
 // pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:13:29: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
 // Try adding either an explicit non-'null' default value or the 'required' modifier.
 //   void _injectedMethod([int i]) {}
@@ -42,6 +32,16 @@
 // void method([int i]) {}
 //                  ^
 //
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:17:25: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
+// void patchedMethod([int i]) {}
+//                         ^
+//
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:19:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
+// void _injectedMethod([int i]) {}
+//                           ^
+//
 import self as test;
 import "dart:_internal" as _in;
 import "dart:core" as core;
diff --git a/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.strong.modular.expect b/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.strong.modular.expect
index ab03b8e..b798b46 100644
--- a/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.strong.modular.expect
+++ b/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.strong.modular.expect
@@ -22,16 +22,6 @@
 //   void patchedMethod([int i]) {}
 //                           ^
 //
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:17:25: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
-// Try adding either an explicit non-'null' default value or the 'required' modifier.
-// void patchedMethod([int i]) {}
-//                         ^
-//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:19:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
-// Try adding either an explicit non-'null' default value or the 'required' modifier.
-// void _injectedMethod([int i]) {}
-//                           ^
-//
 // pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:13:29: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
 // Try adding either an explicit non-'null' default value or the 'required' modifier.
 //   void _injectedMethod([int i]) {}
@@ -42,6 +32,16 @@
 // void method([int i]) {}
 //                  ^
 //
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:17:25: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
+// void patchedMethod([int i]) {}
+//                         ^
+//
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:19:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
+// void _injectedMethod([int i]) {}
+//                           ^
+//
 import self as test;
 import "dart:_internal" as _in;
 import "dart:core" as core;
diff --git a/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.strong.outline.expect b/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.strong.outline.expect
index c234da4..30b87a5 100644
--- a/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.strong.outline.expect
+++ b/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.strong.outline.expect
@@ -20,16 +20,6 @@
 //   void patchedMethod([int i]) {}
 //                           ^
 //
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:17:25: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
-// Try adding either an explicit non-'null' default value or the 'required' modifier.
-// void patchedMethod([int i]) {}
-//                         ^
-//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:19:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
-// Try adding either an explicit non-'null' default value or the 'required' modifier.
-// void _injectedMethod([int i]) {}
-//                           ^
-//
 // pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:13:29: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
 // Try adding either an explicit non-'null' default value or the 'required' modifier.
 //   void _injectedMethod([int i]) {}
@@ -40,6 +30,16 @@
 // void method([int i]) {}
 //                  ^
 //
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:17:25: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
+// void patchedMethod([int i]) {}
+//                         ^
+//
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:19:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
+// void _injectedMethod([int i]) {}
+//                           ^
+//
 import self as self2;
 import "dart:_internal" as _in;
 import "dart:core" as core;
diff --git a/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.strong.transformed.expect
index ab03b8e..b798b46 100644
--- a/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.strong.transformed.expect
@@ -22,16 +22,6 @@
 //   void patchedMethod([int i]) {}
 //                           ^
 //
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:17:25: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
-// Try adding either an explicit non-'null' default value or the 'required' modifier.
-// void patchedMethod([int i]) {}
-//                         ^
-//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:19:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
-// Try adding either an explicit non-'null' default value or the 'required' modifier.
-// void _injectedMethod([int i]) {}
-//                           ^
-//
 // pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:13:29: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
 // Try adding either an explicit non-'null' default value or the 'required' modifier.
 //   void _injectedMethod([int i]) {}
@@ -42,6 +32,16 @@
 // void method([int i]) {}
 //                  ^
 //
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:17:25: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
+// void patchedMethod([int i]) {}
+//                         ^
+//
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:19:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
+// void _injectedMethod([int i]) {}
+//                           ^
+//
 import self as test;
 import "dart:_internal" as _in;
 import "dart:core" as core;
diff --git a/pkg/front_end/testcases/strong.status b/pkg/front_end/testcases/strong.status
index 57373f4..769106e 100644
--- a/pkg/front_end/testcases/strong.status
+++ b/pkg/front_end/testcases/strong.status
@@ -99,11 +99,14 @@
 general/mixin_from_patch/main: SemiFuzzFailure
 general/multiple_class_patches/main: SemiFuzzFailure
 general/nested_lib_spec/main: SemiFuzzFailure
+general/patching/main: SemiFuzzFailure
 general/patch_annotations/main: SemiFuzzFailure
 general/patch_conflict/main: SemiFuzzFailure
 general/patch_extends_implements/main: SemiFuzzFailure
 general/patch_extension_scope/main: SemiFuzzFailure
 general/patch_getter/main: SemiFuzzFailure
+general/patch_prefix_access/main: SemiFuzzFailure
+general/patch_type_parameters/main: SemiFuzzFailure
 general/tear_off_patch/main: SemiFuzzFailure
 late_lowering/injected_late_field_checks/main: SemiFuzzFailure
 late_lowering/issue41436/issue41436: SemiFuzzFailure