Version 2.18.0-26.0.dev

Merge commit 'ba8b4c84048dd9e1247de641314566aeb7d481f3' into 'dev'
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_super_parameters.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_super_parameters.dart
index 4f150ee..7401c0c 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_super_parameters.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_super_parameters.dart
@@ -138,18 +138,19 @@
       // Convert the parameters.
       for (var parameterData in allParameters) {
         var keyword = parameterData.finalKeyword;
+        var nameOffset = parameterData.name.offset;
 
         void insertSuper() {
           if (keyword == null) {
-            builder.addSimpleInsertion(parameterData.nameOffset, 'super.');
+            builder.addSimpleInsertion(nameOffset, 'super.');
           } else {
             var tokenAfterKeyword = keyword.next!;
-            if (tokenAfterKeyword.offset == parameterData.nameOffset) {
+            if (tokenAfterKeyword.offset == nameOffset) {
               builder.addSimpleReplacement(
                   range.startStart(keyword, tokenAfterKeyword), 'super.');
             } else {
               builder.addDeletion(range.startStart(keyword, tokenAfterKeyword));
-              builder.addSimpleInsertion(parameterData.nameOffset, 'super.');
+              builder.addSimpleInsertion(nameOffset, 'super.');
             }
           }
         }
@@ -163,7 +164,7 @@
             // This only happens when the type is an inline function type with
             // no return type, such as `f(int i)`. Inline function types can't
             // have a `final` keyword unless there's an error in the code.
-            builder.addSimpleInsertion(parameterData.nameOffset, 'super.');
+            builder.addSimpleInsertion(nameOffset, 'super.');
           } else {
             if (keyword == null) {
               builder.addSimpleReplacement(primaryRange, 'super.');
@@ -181,6 +182,9 @@
               }
             }
           }
+          if (parameterData.nullInitializer) {
+            builder.addSimpleInsertion(parameterData.name.end, ' = null');
+          }
           var parameterRange = typeToDelete.parameterRange;
           if (parameterRange != null) {
             builder.addDeletion(parameterRange);
@@ -250,7 +254,8 @@
       defaultValueRange:
           _defaultValueRange(parameterNode, superParameter, parameter.element),
       finalKeyword: _finalKeyword(parameterNode),
-      nameOffset: identifier.offset,
+      name: identifier,
+      nullInitializer: _nullInitializer(parameterNode, superParameter),
       parameterIndex: parameter.index,
       typeToDelete: superType == thisType ? _type(parameterNode) : null,
     );
@@ -323,6 +328,15 @@
     return true;
   }
 
+  /// Return [true] if the parameter has no default value
+  /// and the parameter in the super constructor has a default one
+  bool _nullInitializer(
+      FormalParameter parameter, ParameterElement superParameter) {
+    return parameter is DefaultFormalParameter &&
+        parameter.defaultValue == null &&
+        superParameter.defaultValueCode != null;
+  }
+
   /// Return the parameter corresponding to the [expression], or `null` if the
   /// expression isn't a simple reference to one of the normal parameters in the
   /// constructor being converted.
@@ -436,12 +450,15 @@
   /// be deleted.
   final _TypeData? typeToDelete;
 
-  /// The offset of the name.
-  final int nameOffset;
+  /// The name.
+  final Identifier name;
+
+  /// Whether to add a default initializer with `null` value or not.
+  final bool nullInitializer;
 
   /// The range of the default value that is to be deleted from the parameter
-  /// list, or `null` if there is no default value, the default value isn't to
-  /// be deleted.
+  /// list, or `null` if there is no default value, or the default value isn't
+  /// to be deleted.
   final SourceRange? defaultValueRange;
 
   /// The index of the parameter to be updated.
@@ -454,8 +471,9 @@
   _ParameterData(
       {required this.finalKeyword,
       required this.typeToDelete,
-      required this.nameOffset,
+      required this.name,
       required this.defaultValueRange,
+      required this.nullInitializer,
       required this.parameterIndex,
       required this.argumentIndex});
 }
diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_to_super_parameters_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_to_super_parameters_test.dart
index 1b070d0..aab6970 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/convert_to_super_parameters_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/convert_to_super_parameters_test.dart
@@ -508,4 +508,50 @@
 }
 ''');
   }
+
+  Future<void> test_super_defaultValue() async {
+    await resolveTestCode('''
+class Foo {
+  Foo({this.value = 10});
+  final int? value;
+}
+
+class Bar extends Foo {
+  Bar({int? value}) : super(value: value);
+}
+''');
+    await assertHasFix('''
+class Foo {
+  Foo({this.value = 10});
+  final int? value;
+}
+
+class Bar extends Foo {
+  Bar({super.value = null});
+}
+''');
+  }
+
+  Future<void> test_super_defaultValue_final() async {
+    await resolveTestCode('''
+class Foo {
+  Foo({this.value = 10});
+  final int? value;
+}
+
+class Bar extends Foo {
+  Bar({final int? value}) : super(value: value);
+}
+''');
+    await assertHasFix('''
+class Foo {
+  Foo({this.value = 10});
+  final int? value;
+}
+
+class Bar extends Foo {
+  Bar({super.value = null});
+}
+''');
+  }
 }
diff --git a/pkg/analyzer/lib/src/dart/error/ffi_code.g.dart b/pkg/analyzer/lib/src/dart/error/ffi_code.g.dart
index c52348a..ae6c868 100644
--- a/pkg/analyzer/lib/src/dart/error/ffi_code.g.dart
+++ b/pkg/analyzer/lib/src/dart/error/ffi_code.g.dart
@@ -927,7 +927,9 @@
   );
 
   /**
-   * No parameters.
+   * Parameters:
+   * 0: the type that is missing a native type annotation
+   * 1: the superclass which is extended by this field's class
    */
   // #### Description
   //
@@ -966,8 +968,8 @@
   // ```
   static const FfiCode MISSING_ANNOTATION_ON_STRUCT_FIELD = FfiCode(
     'MISSING_ANNOTATION_ON_STRUCT_FIELD',
-    "Fields in a struct class must either have the type 'Pointer' or an "
-        "annotation indicating the native type.",
+    "Fields of type '{0}' in a subclass of '{1}' must have an annotation "
+        "indicating the native type.",
     correctionMessage: "Try adding an annotation.",
     hasPublishedDocs: true,
   );
diff --git a/pkg/analyzer/lib/src/error/deprecated_member_use_verifier.dart b/pkg/analyzer/lib/src/error/deprecated_member_use_verifier.dart
index ff183f5..1807478 100644
--- a/pkg/analyzer/lib/src/error/deprecated_member_use_verifier.dart
+++ b/pkg/analyzer/lib/src/error/deprecated_member_use_verifier.dart
@@ -146,6 +146,10 @@
       return;
     }
 
+    if (element is ParameterElement && element.isNotOptional) {
+      return;
+    }
+
     var errorNode = node;
     var parent = node.parent;
     if (parent is AssignmentExpression && parent.leftHandSide == node) {
@@ -204,11 +208,7 @@
       _visitParametersAndArguments(
         element.parameters,
         arguments.arguments,
-        (parameter, argument) {
-          if (parameter.isOptional) {
-            _checkForDeprecated(parameter, argument);
-          }
-        },
+        _checkForDeprecated,
       );
     }
   }
diff --git a/pkg/analyzer/lib/src/generated/ffi_verifier.dart b/pkg/analyzer/lib/src/generated/ffi_verifier.dart
index 4c8241b..54e6e12 100644
--- a/pkg/analyzer/lib/src/generated/ffi_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/ffi_verifier.dart
@@ -702,8 +702,8 @@
   /// Validate that the [annotations] include exactly one annotation that
   /// satisfies the [requiredTypes]. If an error is produced that cannot be
   /// associated with an annotation, associate it with the [errorNode].
-  void _validateAnnotations(AstNode errorNode, NodeList<Annotation> annotations,
-      _PrimitiveDartType requiredType) {
+  void _validateAnnotations(TypeAnnotation errorNode,
+      NodeList<Annotation> annotations, _PrimitiveDartType requiredType) {
     bool requiredFound = false;
     List<Annotation> extraAnnotations = [];
     for (Annotation annotation in annotations) {
@@ -734,7 +734,9 @@
       }
     } else if (!requiredFound) {
       _errorReporter.reportErrorForNode(
-          FfiCode.MISSING_ANNOTATION_ON_STRUCT_FIELD, errorNode);
+          FfiCode.MISSING_ANNOTATION_ON_STRUCT_FIELD,
+          errorNode,
+          [errorNode.type!, compound!.extendsClause!.superclass.name.name]);
     }
   }
 
diff --git a/pkg/analyzer/messages.yaml b/pkg/analyzer/messages.yaml
index 925a70d..5884bac 100644
--- a/pkg/analyzer/messages.yaml
+++ b/pkg/analyzer/messages.yaml
@@ -16366,9 +16366,12 @@
       }
       ```
   MISSING_ANNOTATION_ON_STRUCT_FIELD:
-    problemMessage: "Fields in a struct class must either have the type 'Pointer' or an annotation indicating the native type."
+    problemMessage: "Fields of type '{0}' in a subclass of '{1}' must have an annotation indicating the native type."
     correctionMessage: Try adding an annotation.
-    comment: No parameters.
+    comment: |-
+      Parameters:
+      0: the type that is missing a native type annotation
+      1: the superclass which is extended by this field's class
     hasPublishedDocs: true
     documentation: |-
       #### Description
diff --git a/pkg/analyzer/tool/diagnostics/diagnostics.md b/pkg/analyzer/tool/diagnostics/diagnostics.md
index c3070d3..d30bca8 100644
--- a/pkg/analyzer/tool/diagnostics/diagnostics.md
+++ b/pkg/analyzer/tool/diagnostics/diagnostics.md
@@ -10092,8 +10092,8 @@
 
 ### missing_annotation_on_struct_field
 
-_Fields in a struct class must either have the type 'Pointer' or an annotation
-indicating the native type._
+_Fields of type '{0}' in a subclass of '{1}' must have an annotation indicating
+the native type._
 
 #### Description
 
diff --git a/pkg/compiler/lib/src/colors.dart b/pkg/compiler/lib/src/colors.dart
index f2132cf..4aaae15 100644
--- a/pkg/compiler/lib/src/colors.dart
+++ b/pkg/compiler/lib/src/colors.dart
@@ -2,8 +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.
 
-// @dart = 2.10
-
 library dart2js.colors;
 
 // See http://en.wikipedia.org/wiki/ANSI_escape_code#CSI_codes
diff --git a/pkg/compiler/lib/src/common/metrics.dart b/pkg/compiler/lib/src/common/metrics.dart
index 0743946..259ec13 100644
--- a/pkg/compiler/lib/src/common/metrics.dart
+++ b/pkg/compiler/lib/src/common/metrics.dart
@@ -2,8 +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.
 
-// @dart = 2.10
-
 library dart2js.common.metrics;
 
 /// A collection of metrics that is normally associated with a task.
@@ -49,10 +47,10 @@
   }
 
   @override
-  Iterable<Metric> get primary => _primary /*!*/;
+  Iterable<Metric> get primary => _primary;
 
   @override
-  Iterable<Metric> get secondary => _secondary /*!*/;
+  Iterable<Metric> get secondary => _secondary;
 }
 
 abstract class Metric<T> {
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index 55d0d01..fdda1c8 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -749,8 +749,6 @@
 
   void _reportDiagnosticMessage(
       DiagnosticMessage diagnosticMessage, api.Diagnostic kind) {
-    // [:span.uri:] might be [:null:] in case of a [Script] with no [uri]. For
-    // instance in the [Types] constructor in typechecker.dart.
     var span = diagnosticMessage.sourceSpan;
     var message = diagnosticMessage.message;
     if (span == null || span.uri == null) {
diff --git a/pkg/compiler/lib/src/environment.dart b/pkg/compiler/lib/src/environment.dart
index 295f17c..cb5fdbd 100644
--- a/pkg/compiler/lib/src/environment.dart
+++ b/pkg/compiler/lib/src/environment.dart
@@ -2,8 +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.
 
-// @dart = 2.10
-
 /// Collects definitions provided to the compiler via the `-D` flag.
 ///
 /// Environment variables can be used in the user code in two ways. From
diff --git a/pkg/compiler/lib/src/inferrer/debug.dart b/pkg/compiler/lib/src/inferrer/debug.dart
index c2bef3e..def9a7d 100644
--- a/pkg/compiler/lib/src/inferrer/debug.dart
+++ b/pkg/compiler/lib/src/inferrer/debug.dart
@@ -2,8 +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.
 
-// @dart = 2.10
-
 /// Values used only for debugging type inference.
 library compiler.src.inferrer.debug;
 
diff --git a/pkg/compiler/lib/src/ir/static_type_provider.dart b/pkg/compiler/lib/src/ir/static_type_provider.dart
index 19245d7..2dc7ace 100644
--- a/pkg/compiler/lib/src/ir/static_type_provider.dart
+++ b/pkg/compiler/lib/src/ir/static_type_provider.dart
@@ -2,8 +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.
 
-// @dart = 2.10
-
 import 'package:kernel/ast.dart' as ir;
 
 /// Interface for accessing static types on expressions.
diff --git a/pkg/compiler/lib/src/js/js_debug.dart b/pkg/compiler/lib/src/js/js_debug.dart
index c50a232..c97ef3d 100644
--- a/pkg/compiler/lib/src/js/js_debug.dart
+++ b/pkg/compiler/lib/src/js/js_debug.dart
@@ -2,8 +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.
 
-// @dart = 2.10
-
 /// Helper for debug JS nodes.
 
 library js.debug;
@@ -27,7 +25,7 @@
   @override
   StringBuffer sb = StringBuffer();
 
-  void visitNodeWithChildren(Node node, String type, [Map params]) {
+  void visitNodeWithChildren(Node node, String type, [Map? params]) {
     openNode(node, type, params);
     node.visitChildren(this);
     closeNode();
diff --git a/pkg/compiler/lib/src/js/placeholder_safety.dart b/pkg/compiler/lib/src/js/placeholder_safety.dart
index 70a44d8..6a08913 100644
--- a/pkg/compiler/lib/src/js/placeholder_safety.dart
+++ b/pkg/compiler/lib/src/js/placeholder_safety.dart
@@ -2,11 +2,9 @@
 // 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.
 
-// @dart = 2.10
-
 library js.safety;
 
-import "js.dart" as js;
+import 'package:js_ast/js_ast.dart' as js;
 
 typedef PositionPredicate = bool Function(int position);
 
@@ -196,7 +194,7 @@
   @override
   int visitVariableInitialization(js.VariableInitialization node) {
     js.Expression left = node.declaration;
-    js.Expression right = node.value;
+    js.Expression? right = node.value;
 
     visit(left);
     if (left is js.InterpolatedNode) {
diff --git a/pkg/compiler/lib/src/js_backend/runtime_types.dart b/pkg/compiler/lib/src/js_backend/runtime_types.dart
index 8f63902..8b351dc 100644
--- a/pkg/compiler/lib/src/js_backend/runtime_types.dart
+++ b/pkg/compiler/lib/src/js_backend/runtime_types.dart
@@ -546,6 +546,20 @@
     Set<ClassEntity> typeLiterals = {};
     Set<ClassEntity> typeArguments = {};
 
+    Iterable<DartType> instantiateTypeVariable(TypeVariableEntity variable) {
+      Entity declaration = variable.typeDeclaration;
+      int index = variable.index;
+      if (declaration is ClassEntity) {
+        return typeVariableTests
+            .classInstantiationsOf(declaration)
+            .map((InterfaceType interface) => interface.typeArguments[index]);
+      } else {
+        return typeVariableTests.instantiationsOf(declaration).map(
+            (GenericInstantiation instantiation) =>
+                instantiation.typeArguments[index]);
+      }
+    }
+
     // The [liveTypeVisitor] is used to register class use in the type of
     // instantiated objects like `new T` and the function types of
     // tear offs and closures.
@@ -559,27 +573,28 @@
     //    new A<B Function(C)>();
     //
     // makes A and B live but C tested.
-    TypeVisitor liveTypeVisitor =
-        TypeVisitor(onClass: (ClassEntity cls, {TypeVisitorState state}) {
-      ClassUse classUse = classUseMap.putIfAbsent(cls, () => ClassUse());
-      switch (state) {
-        case TypeVisitorState.covariantTypeArgument:
-          classUse.typeArgument = true;
-          typeArguments.add(cls);
-          break;
-        case TypeVisitorState.contravariantTypeArgument:
-          classUse.typeArgument = true;
-          classUse.checkedTypeArgument = true;
-          typeArguments.add(cls);
-          break;
-        case TypeVisitorState.typeLiteral:
-          classUse.typeLiteral = true;
-          typeLiterals.add(cls);
-          break;
-        case TypeVisitorState.direct:
-          break;
-      }
-    });
+    TypeVisitor liveTypeVisitor = TypeVisitor(
+        onClass: (ClassEntity cls, {TypeVisitorState state}) {
+          ClassUse classUse = classUseMap.putIfAbsent(cls, () => ClassUse());
+          switch (state) {
+            case TypeVisitorState.covariantTypeArgument:
+              classUse.typeArgument = true;
+              typeArguments.add(cls);
+              break;
+            case TypeVisitorState.contravariantTypeArgument:
+              classUse.typeArgument = true;
+              classUse.checkedTypeArgument = true;
+              typeArguments.add(cls);
+              break;
+            case TypeVisitorState.typeLiteral:
+              classUse.typeLiteral = true;
+              typeLiterals.add(cls);
+              break;
+            case TypeVisitorState.direct:
+              break;
+          }
+        },
+        instantiateTypeVariable: instantiateTypeVariable);
 
     // The [testedTypeVisitor] is used to register class use in type tests like
     // `o is T` and `o as T` (both implicit and explicit).
@@ -593,26 +608,27 @@
     //    o is A<B Function(C)>;
     //
     // makes A and B tested but C live.
-    TypeVisitor testedTypeVisitor =
-        TypeVisitor(onClass: (ClassEntity cls, {TypeVisitorState state}) {
-      ClassUse classUse = classUseMap.putIfAbsent(cls, () => ClassUse());
-      switch (state) {
-        case TypeVisitorState.covariantTypeArgument:
-          classUse.typeArgument = true;
-          classUse.checkedTypeArgument = true;
-          typeArguments.add(cls);
-          break;
-        case TypeVisitorState.contravariantTypeArgument:
-          classUse.typeArgument = true;
-          typeArguments.add(cls);
-          break;
-        case TypeVisitorState.typeLiteral:
-          break;
-        case TypeVisitorState.direct:
-          classUse.checkedInstance = true;
-          break;
-      }
-    });
+    TypeVisitor testedTypeVisitor = TypeVisitor(
+        onClass: (ClassEntity cls, {TypeVisitorState state}) {
+          ClassUse classUse = classUseMap.putIfAbsent(cls, () => ClassUse());
+          switch (state) {
+            case TypeVisitorState.covariantTypeArgument:
+              classUse.typeArgument = true;
+              classUse.checkedTypeArgument = true;
+              typeArguments.add(cls);
+              break;
+            case TypeVisitorState.contravariantTypeArgument:
+              classUse.typeArgument = true;
+              typeArguments.add(cls);
+              break;
+            case TypeVisitorState.typeLiteral:
+              break;
+            case TypeVisitorState.direct:
+              classUse.checkedInstance = true;
+              break;
+          }
+        },
+        instantiateTypeVariable: instantiateTypeVariable);
 
     codegenWorld.instantiatedClasses.forEach((ClassEntity cls) {
       ClassUse classUse = classUseMap.putIfAbsent(cls, () => ClassUse());
@@ -875,15 +891,14 @@
 }
 
 class TypeVisitor extends DartTypeVisitor<void, TypeVisitorState> {
+  final Set<TypeVariableType> _visitedTypeVariables = {};
   final Set<FunctionTypeVariable> _visitedFunctionTypeVariables = {};
 
   final void Function(ClassEntity entity, {TypeVisitorState state}) onClass;
-  final void Function(TypeVariableEntity entity, {TypeVisitorState state})
-      onTypeVariable;
-  final void Function(FunctionType type, {TypeVisitorState state})
-      onFunctionType;
+  final Iterable<DartType> Function(TypeVariableEntity entity)
+      instantiateTypeVariable;
 
-  TypeVisitor({this.onClass, this.onTypeVariable, this.onFunctionType});
+  TypeVisitor({this.onClass, this.instantiateTypeVariable});
 
   void visitType(DartType type, TypeVisitorState state) =>
       type.accept(this, state);
@@ -938,8 +953,10 @@
 
   @override
   void visitTypeVariableType(TypeVariableType type, TypeVisitorState state) {
-    if (onTypeVariable != null) {
-      onTypeVariable(type.element, state: state);
+    if (_visitedTypeVariables.add(type) && instantiateTypeVariable != null) {
+      for (DartType instantiation in instantiateTypeVariable(type.element)) {
+        visitType(instantiation, state);
+      }
     }
   }
 
@@ -952,9 +969,6 @@
 
   @override
   void visitFunctionType(FunctionType type, TypeVisitorState state) {
-    if (onFunctionType != null) {
-      onFunctionType(type, state: state);
-    }
     // Visit all nested types as type arguments; these types are not runtime
     // instances but runtime type representations.
     visitType(type.returnType, covariantArgument(state));
diff --git a/pkg/compiler/lib/src/js_backend/runtime_types_resolution.dart b/pkg/compiler/lib/src/js_backend/runtime_types_resolution.dart
index 365a3f8..ce85047 100644
--- a/pkg/compiler/lib/src/js_backend/runtime_types_resolution.dart
+++ b/pkg/compiler/lib/src/js_backend/runtime_types_resolution.dart
@@ -258,6 +258,12 @@
     _instantiationMap.forEach(f);
   }
 
+  Set<GenericInstantiation> instantiationsOf(Entity target) =>
+      _instantiationMap[target] ?? const {};
+
+  Set<InterfaceType> classInstantiationsOf(ClassEntity cls) =>
+      _classInstantiationMap[cls] ?? const {};
+
   ClassNode _getClassNode(ClassEntity cls) {
     return _classes.putIfAbsent(cls, () => ClassNode(cls));
   }
@@ -554,12 +560,12 @@
     TypeVariableEntity entity = variable.element;
     Entity declaration = entity.typeDeclaration;
     if (declaration is ClassEntity) {
-      _classInstantiationMap[declaration]?.forEach((InterfaceType type) {
+      classInstantiationsOf(declaration).forEach((InterfaceType type) {
         _addImplicitCheck(type.typeArguments[entity.index]);
       });
     } else {
-      _instantiationMap[declaration]
-          ?.forEach((GenericInstantiation instantiation) {
+      instantiationsOf(declaration)
+          .forEach((GenericInstantiation instantiation) {
         _addImplicitCheck(instantiation.typeArguments[entity.index]);
       });
       _world.forEachStaticTypeArgument(
@@ -598,7 +604,7 @@
       // one of its type arguments in an is-check and add the arguments to the
       // set of is-checks.
       for (ClassEntity base in _classHierarchy.allSubtypesOf(cls)) {
-        _classInstantiationMap[base]?.forEach((InterfaceType subtype) {
+        classInstantiationsOf(base).forEach((InterfaceType subtype) {
           InterfaceType instance = _dartTypes.asInstanceOf(subtype, cls);
           assert(instance != null);
           _addImplicitChecks(instance.typeArguments);
diff --git a/pkg/compiler/lib/src/script.dart b/pkg/compiler/lib/src/script.dart
deleted file mode 100644
index 01a40dc..0000000
--- a/pkg/compiler/lib/src/script.dart
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (c) 2011, 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.
-
-// @dart = 2.10
-
-library dart2js.script;
-
-import 'io/source_file.dart';
-
-class Script {
-  final SourceFile file;
-
-  /// The readable URI from which this script was loaded.
-  ///
-  /// See [LibraryLoader] for terminology on URIs.
-  final Uri readableUri;
-
-  /// The resource URI from which this script was loaded.
-  ///
-  /// See [LibraryLoader] for terminology on URIs.
-  final Uri resourceUri;
-
-  /// This script was synthesized.
-  final bool isSynthesized;
-
-  Script(this.readableUri, this.resourceUri, this.file) : isSynthesized = false;
-
-  Script.synthetic(Uri uri)
-      : readableUri = uri,
-        resourceUri = uri,
-        file = StringSourceFile.fromUri(
-            uri, "// Synthetic source file generated for '$uri'."),
-        isSynthesized = true;
-
-  String get text => (file == null) ? null : file.slowText();
-  String get name => (file == null) ? null : file.filename;
-
-  /// Creates a new [Script] with the same URIs, but new content ([file]).
-  Script copyWithFile(SourceFile file) {
-    return Script(readableUri, resourceUri, file);
-  }
-}
diff --git a/pkg/compiler/test/rti/emission/future_or_generic2.dart b/pkg/compiler/test/rti/emission/future_or_generic2.dart
index 1bb791c..dae38e57 100644
--- a/pkg/compiler/test/rti/emission/future_or_generic2.dart
+++ b/pkg/compiler/test/rti/emission/future_or_generic2.dart
@@ -18,10 +18,10 @@
 /*class: B:checkedInstance,checkedTypeArgument,checks=[],instance,typeArgument*/
 class B<T> {}
 
-/*class: C:checkedInstance,typeArgument*/
+/*class: C:checkedInstance,checkedTypeArgument,typeArgument*/
 class C {}
 
-/*class: D:checkedInstance,typeArgument*/
+/*class: D:checkedInstance,checkedTypeArgument,typeArgument*/
 class D {}
 
 main() {
diff --git a/tests/web/regress/issue/48277a_test.dart b/tests/web/regress/issue/48277a_test.dart
new file mode 100644
index 0000000..204a91d
--- /dev/null
+++ b/tests/web/regress/issue/48277a_test.dart
@@ -0,0 +1,17 @@
+// Copyright (c) 2022, 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 'package:expect/expect.dart';
+
+import 'dart:collection';
+
+class Foo<T> {}
+
+const f1 = Foo<Queue>.new;
+const f2 = Foo<Queue<String>>.new;
+
+main() {
+  Expect.type<Foo<Iterable>>(f1());
+  Expect.type<Foo<Iterable<Comparable>>>(f2());
+}
diff --git a/tests/web/regress/issue/48277b_test.dart b/tests/web/regress/issue/48277b_test.dart
new file mode 100644
index 0000000..32acc0d
--- /dev/null
+++ b/tests/web/regress/issue/48277b_test.dart
@@ -0,0 +1,19 @@
+// Copyright (c) 2022, 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 'package:expect/expect.dart';
+
+import 'dart:collection';
+
+class Foo<T> {
+  static Foo<T> make<T>() => Foo<T>();
+}
+
+const f1 = Foo.make<Queue>;
+const f2 = Foo.make<Queue<String>>;
+
+main() {
+  Expect.type<Foo<Iterable>>(f1());
+  Expect.type<Foo<Iterable<Comparable>>>(f2());
+}
diff --git a/tests/web_2/regress/issue/48277b_test.dart b/tests/web_2/regress/issue/48277b_test.dart
new file mode 100644
index 0000000..32acc0d
--- /dev/null
+++ b/tests/web_2/regress/issue/48277b_test.dart
@@ -0,0 +1,19 @@
+// Copyright (c) 2022, 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 'package:expect/expect.dart';
+
+import 'dart:collection';
+
+class Foo<T> {
+  static Foo<T> make<T>() => Foo<T>();
+}
+
+const f1 = Foo.make<Queue>;
+const f2 = Foo.make<Queue<String>>;
+
+main() {
+  Expect.type<Foo<Iterable>>(f1());
+  Expect.type<Foo<Iterable<Comparable>>>(f2());
+}
diff --git a/tools/VERSION b/tools/VERSION
index 5cdf643..ad16b8c 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
 MAJOR 2
 MINOR 18
 PATCH 0
-PRERELEASE 25
+PRERELEASE 26
 PRERELEASE_PATCH 0
\ No newline at end of file