Version 2.18.0-168.0.dev

Merge commit '7a8f742425174182568488bc29792af099101813' into 'dev'
diff --git a/pkg/front_end/lib/src/fasta/builder/omitted_type_builder.dart b/pkg/front_end/lib/src/fasta/builder/omitted_type_builder.dart
index 5ffdf21..3b7bbbf 100644
--- a/pkg/front_end/lib/src/fasta/builder/omitted_type_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/omitted_type_builder.dart
@@ -3,6 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import 'package:kernel/ast.dart';
+import 'package:kernel/type_environment.dart';
 
 import '../source/source_library_builder.dart';
 import 'library_builder.dart';
@@ -10,7 +11,9 @@
 import 'nullability_builder.dart';
 import 'type_builder.dart';
 
-class OmittedTypeBuilder extends TypeBuilder {
+abstract class OmittedTypeBuilder extends TypeBuilder {
+  const OmittedTypeBuilder();
+
   @override
   DartType build(LibraryBuilder library, TypeUse typeUse) {
     throw new UnsupportedError('$runtimeType.build');
@@ -66,10 +69,28 @@
     return this;
   }
 
+  bool get hasType;
+
+  DartType get type;
+}
+
+class ImplicitTypeBuilder extends OmittedTypeBuilder {
+  const ImplicitTypeBuilder();
+
+  @override
+  bool get hasType => true;
+
+  @override
+  DartType get type => const DynamicType();
+}
+
+class InferableTypeBuilder extends OmittedTypeBuilder {
+  @override
   bool get hasType => _type != null;
 
   DartType? _type;
 
+  @override
   DartType get type => _type!;
 
   List<InferredTypeListener>? _listeners;
@@ -102,9 +123,46 @@
   void registerInferredType(DartType type) {
     _registerType(type);
   }
+
+  Inferable? _inferable;
+
+  Inferable? get inferable => _inferable;
+
+  @override
+  void registerInferable(Inferable inferable) {
+    assert(
+        _inferable == null,
+        "Inferable $_inferable has already been register, "
+        "trying to register $inferable.");
+    _inferable = inferable;
+  }
+
+  /// Triggers inference of this type.
+  ///
+  /// If an [Inferable] has been register, this is called to infer the type of
+  /// this builder. Otherwise the type is inferred to be `dynamic`.
+  void inferType(TypeEnvironment typeEnvironment) {
+    if (!hasType) {
+      Inferable? inferable = _inferable;
+      if (inferable != null) {
+        inferable.inferTypes(typeEnvironment);
+      } else {
+        registerInferredType(const DynamicType());
+      }
+      assert(hasType);
+    }
+  }
 }
 
 /// Listener for the late computation of an inferred type.
 abstract class InferredTypeListener {
+  /// Called when the type of an [InferableTypeBuilder] has been computed.
   void onInferredType(DartType type);
 }
+
+/// Interface for builders that can infer the type of an [InferableTypeBuilder].
+abstract class Inferable {
+  /// Triggers the inference of the types of one or more
+  /// [InferableTypeBuilder]s.
+  void inferTypes(TypeEnvironment typeEnvironment);
+}
diff --git a/pkg/front_end/lib/src/fasta/builder/type_builder.dart b/pkg/front_end/lib/src/fasta/builder/type_builder.dart
index b694a5f..e7d81cfa 100644
--- a/pkg/front_end/lib/src/fasta/builder/type_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/type_builder.dart
@@ -327,9 +327,21 @@
 
   bool get isVoidType;
 
+  /// Register [type] as the inferred type of this type builder.
+  ///
+  /// If this is not an [InferableTypeBuilder] this method will throw.
   void registerInferredType(DartType type) {
     throw new UnsupportedError("${runtimeType}.registerInferredType");
   }
 
+  /// Registers a [listener] that is called when this type has been inferred.
+  // TODO(johnniwinther): Should we handle this for all types or just those
+  // that are inferred or aliases of inferred types?
   void registerInferredTypeListener(InferredTypeListener listener) {}
+
+  /// Registers the [Inferable] object to be called when this type needs to be
+  /// inferred.
+  ///
+  /// If this type is not an [InferableTypeBuilder], this call is a no-op.
+  void registerInferable(Inferable inferable) {}
 }
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
index dfc641f..620037c 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -1754,7 +1754,7 @@
                     /* metadata = */ null,
                     FormalParameterKind.requiredPositional,
                     /* modifiers = */ 0,
-                    libraryBuilder.addInferableType(),
+                    const ImplicitTypeBuilder(),
                     formal.name!,
                     libraryBuilder,
                     formal.fileOffset,
@@ -4279,7 +4279,7 @@
       }
     }
     TypeBuilder type = formals.toFunctionType(
-        returnType ?? libraryBuilder.addInferableType(),
+        returnType ?? const ImplicitTypeBuilder(),
         libraryBuilder.nullableBuilderIfTrue(questionMark != null),
         typeVariables);
     exitLocalScope();
@@ -4486,7 +4486,7 @@
           null,
           kind,
           modifiers,
-          type ?? libraryBuilder.addInferableType(),
+          type ?? const ImplicitTypeBuilder(),
           name?.name ?? '',
           libraryBuilder,
           offsetForToken(nameToken),
@@ -4563,7 +4563,7 @@
       reportErrorIfNullableType(question);
     }
     TypeBuilder type = formals.toFunctionType(
-        returnType ?? libraryBuilder.addInferableType(),
+        returnType ?? const ImplicitTypeBuilder(),
         libraryBuilder.nullableBuilderIfTrue(question != null),
         typeVariables);
     exitLocalScope();
diff --git a/pkg/front_end/lib/src/fasta/kernel/hierarchy/members_node.dart b/pkg/front_end/lib/src/fasta/kernel/hierarchy/members_node.dart
index 1c689cc..c844468 100644
--- a/pkg/front_end/lib/src/fasta/kernel/hierarchy/members_node.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/hierarchy/members_node.dart
@@ -91,10 +91,10 @@
       Iterable<ClassMember> overriddenMembers) {
     assert(!declaredMember.isGetter && !declaredMember.isSetter);
     if (declaredMember.classBuilder == classBuilder &&
-        (declaredMember.returnType is OmittedTypeBuilder ||
+        (declaredMember.returnType is InferableTypeBuilder ||
             declaredMember.formals != null &&
                 declaredMember.formals!.any(
-                    (parameter) => parameter.type is OmittedTypeBuilder))) {
+                    (parameter) => parameter.type is InferableTypeBuilder))) {
       Procedure declaredProcedure = declaredMember.member as Procedure;
       FunctionNode declaredFunction = declaredProcedure.function;
       List<TypeParameter> declaredTypeParameters =
@@ -121,7 +121,7 @@
       bool cantInferReturnType = false;
       List<FormalParameterBuilder>? cantInferParameterTypes;
 
-      if (declaredMember.returnType is OmittedTypeBuilder) {
+      if (declaredMember.returnType is InferableTypeBuilder) {
         if (combinedMemberSignatureType == null) {
           inferredReturnType = const InvalidType();
           cantInferReturnType = true;
@@ -132,7 +132,7 @@
       if (declaredMember.formals != null) {
         for (int i = 0; i < declaredPositional.length; i++) {
           FormalParameterBuilder declaredParameter = declaredMember.formals![i];
-          if (declaredParameter.type is! OmittedTypeBuilder) {
+          if (declaredParameter.type is! InferableTypeBuilder) {
             continue;
           }
 
@@ -154,7 +154,7 @@
             i < declaredMember.formals!.length;
             i++) {
           FormalParameterBuilder declaredParameter = declaredMember.formals![i];
-          if (declaredParameter.type is! OmittedTypeBuilder) {
+          if (declaredParameter.type is! InferableTypeBuilder) {
             continue;
           }
 
@@ -189,14 +189,14 @@
             classBuilder, cantInferParameterTypes.single, overriddenMembers);
       }
 
-      if (declaredMember.returnType is OmittedTypeBuilder) {
+      if (declaredMember.returnType is InferableTypeBuilder) {
         inferredReturnType ??= const DynamicType();
         declaredMember.returnType.registerInferredType(inferredReturnType);
       }
       if (declaredMember.formals != null) {
         for (FormalParameterBuilder declaredParameter
             in declaredMember.formals!) {
-          if (declaredParameter.type is OmittedTypeBuilder) {
+          if (declaredParameter.type is InferableTypeBuilder) {
             DartType inferredParameterType =
                 inferredParameterTypes[declaredParameter] ??
                     const DynamicType();
@@ -249,7 +249,7 @@
       Iterable<ClassMember> overriddenMembers) {
     assert(declaredMember.isGetter);
     if (declaredMember.classBuilder == classBuilder &&
-        declaredMember.returnType is OmittedTypeBuilder) {
+        declaredMember.returnType is InferableTypeBuilder) {
       DartType? inferredType;
       overriddenMembers = toSet(classBuilder, overriddenMembers);
 
@@ -313,7 +313,7 @@
     assert(declaredMember.isSetter);
     FormalParameterBuilder parameter = declaredMember.formals!.first;
     if (declaredMember.classBuilder == classBuilder &&
-        parameter.type is OmittedTypeBuilder) {
+        parameter.type is InferableTypeBuilder) {
       DartType? inferredType;
 
       overriddenMembers = toSet(classBuilder, overriddenMembers);
@@ -414,7 +414,7 @@
       SourceFieldBuilder fieldBuilder,
       Iterable<ClassMember> overriddenMembers) {
     if (fieldBuilder.classBuilder == classBuilder &&
-        fieldBuilder.type is OmittedTypeBuilder) {
+        fieldBuilder.type is InferableTypeBuilder) {
       DartType? inferredType;
 
       overriddenMembers = toSet(classBuilder, overriddenMembers);
diff --git a/pkg/front_end/lib/src/fasta/kernel/implicit_field_type.dart b/pkg/front_end/lib/src/fasta/kernel/implicit_field_type.dart
index 7fc4b44c..f5640ea 100644
--- a/pkg/front_end/lib/src/fasta/kernel/implicit_field_type.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/implicit_field_type.dart
@@ -34,8 +34,9 @@
       "declaredNullability", fieldBuilder.charOffset, fieldBuilder.fileUri);
 
   @override
-  Nullability get nullability =>
-      unsupported("nullability", fieldBuilder.charOffset, fieldBuilder.fileUri);
+  Nullability get nullability {
+    unsupported("nullability", fieldBuilder.charOffset, fieldBuilder.fileUri);
+  }
 
   @override
   R accept<R>(DartTypeVisitor<R> v) {
diff --git a/pkg/front_end/lib/src/fasta/kernel/utils.dart b/pkg/front_end/lib/src/fasta/kernel/utils.dart
index 393198a..cb2eede 100644
--- a/pkg/front_end/lib/src/fasta/kernel/utils.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/utils.dart
@@ -234,7 +234,7 @@
     new FixedTypeBuilder(dummyDartType, dummyUri, -1);
 final FormalParameterBuilder dummyFormalParameterBuilder =
     new FormalParameterBuilder(null, FormalParameterKind.requiredPositional, 0,
-        new OmittedTypeBuilder(), '', null, -1,
+        const ImplicitTypeBuilder(), '', null, -1,
         fileUri: dummyUri);
 final TypeVariableBuilder dummyTypeVariableBuilder = new TypeVariableBuilder(
     TypeVariableBuilder.noNameSentinel, null, -1, null,
diff --git a/pkg/front_end/lib/src/fasta/source/outline_builder.dart b/pkg/front_end/lib/src/fasta/source/outline_builder.dart
index 3e826a0..fa979e1 100644
--- a/pkg/front_end/lib/src/fasta/source/outline_builder.dart
+++ b/pkg/front_end/lib/src/fasta/source/outline_builder.dart
@@ -32,6 +32,7 @@
 import '../builder/mixin_application_builder.dart';
 import '../builder/named_type_builder.dart';
 import '../builder/nullability_builder.dart';
+import '../builder/omitted_type_builder.dart';
 import '../builder/type_builder.dart';
 import '../builder/type_variable_builder.dart';
 import '../combinator.dart' show CombinatorBuilder;
@@ -2259,6 +2260,9 @@
           metadata,
           kind,
           modifiers,
+          // TODO(johnniwinther): Avoid creating inferable types for omitted
+          // types in uninferable context, like omitted parameter types of
+          // function types.
           type ?? libraryBuilder.addInferableType(),
           name == null ? FormalParameterBuilder.noNameSentinel : name as String,
           thisKeyword != null,
@@ -2582,7 +2586,7 @@
     List<TypeVariableBuilder>? typeVariables =
         pop() as List<TypeVariableBuilder>?;
     push(libraryBuilder.addFunctionType(
-        returnType ?? libraryBuilder.addInferableType(),
+        returnType ?? const ImplicitTypeBuilder(),
         typeVariables,
         formals,
         libraryBuilder.nullableBuilderIfTrue(questionMark != null),
@@ -2603,7 +2607,7 @@
       reportErrorIfNullableType(question);
     }
     push(libraryBuilder.addFunctionType(
-        returnType ?? libraryBuilder.addInferableType(),
+        returnType ?? const ImplicitTypeBuilder(),
         typeVariables,
         formals,
         libraryBuilder.nullableBuilderIfTrue(question != null),
@@ -2642,7 +2646,7 @@
           hasMembers: false);
       // TODO(cstefantsova): Make sure that RHS of typedefs can't have '?'.
       aliasedType = libraryBuilder.addFunctionType(
-          returnType ?? libraryBuilder.addInferableType(),
+          returnType ?? const ImplicitTypeBuilder(),
           null,
           formals,
           const NullabilityBuilder.omitted(),
diff --git a/pkg/front_end/lib/src/fasta/source/source_constructor_builder.dart b/pkg/front_end/lib/src/fasta/source/source_constructor_builder.dart
index aaca7a6..4d34781 100644
--- a/pkg/front_end/lib/src/fasta/source/source_constructor_builder.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_constructor_builder.dart
@@ -66,7 +66,7 @@
 }
 
 class DeclaredSourceConstructorBuilder extends SourceFunctionBuilderImpl
-    implements SourceConstructorBuilder {
+    implements SourceConstructorBuilder, Inferable {
   @override
   final OmittedTypeBuilder returnType;
 
@@ -141,7 +141,15 @@
         _hasSuperInitializingFormals =
             formals?.any((formal) => formal.isSuperInitializingFormal) ?? false,
         super(metadata, modifiers, name, typeVariables, formals,
-            compilationUnit, charOffset, nativeMethodName);
+            compilationUnit, charOffset, nativeMethodName) {
+    if (formals != null) {
+      for (FormalParameterBuilder formal in formals!) {
+        if (formal.isInitializingFormal || formal.isSuperInitializingFormal) {
+          formal.type.registerInferable(this);
+        }
+      }
+    }
+  }
 
   @override
   SourceClassBuilder get classBuilder =>
@@ -223,7 +231,7 @@
     if (formals != null) {
       bool needsInference = false;
       for (FormalParameterBuilder formal in formals!) {
-        if (formal.type is OmittedTypeBuilder &&
+        if (formal.type is InferableTypeBuilder &&
             (formal.isInitializingFormal || formal.isSuperInitializingFormal)) {
           formal.variable!.type = const UnknownType();
           needsInference = true;
@@ -241,11 +249,16 @@
   }
 
   @override
+  void inferTypes(TypeEnvironment typeEnvironment) {
+    inferFormalTypes(typeEnvironment);
+  }
+
+  @override
   void inferFormalTypes(TypeEnvironment typeEnvironment) {
     if (_hasFormalsInferred) return;
     if (formals != null) {
       for (FormalParameterBuilder formal in formals!) {
-        if (formal.type is OmittedTypeBuilder) {
+        if (formal.type is InferableTypeBuilder) {
           if (formal.isInitializingFormal) {
             formal.finalizeInitializingFormal(classBuilder);
           }
@@ -425,7 +438,7 @@
           }
         }
 
-        if (formal.type is OmittedTypeBuilder) {
+        if (formal.type is InferableTypeBuilder) {
           DartType? type = correspondingSuperFormalType;
           if (substitution.isNotEmpty && type != null) {
             type = substitute(type, substitution);
diff --git a/pkg/front_end/lib/src/fasta/source/source_field_builder.dart b/pkg/front_end/lib/src/fasta/source/source_field_builder.dart
index 3b6f323..a8c4fe0 100644
--- a/pkg/front_end/lib/src/fasta/source/source_field_builder.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_field_builder.dart
@@ -41,7 +41,7 @@
 import 'source_member_builder.dart';
 
 class SourceFieldBuilder extends SourceMemberBuilderImpl
-    implements FieldBuilder, InferredTypeListener {
+    implements FieldBuilder, InferredTypeListener, Inferable {
   @override
   final String name;
 
@@ -263,7 +263,7 @@
           setterReference: fieldSetterReference);
     }
 
-    if (type is OmittedTypeBuilder) {
+    if (type is InferableTypeBuilder) {
       if (!hasInitializer && isStatic) {
         // A static field without type and initializer will always be inferred
         // to have type `dynamic`.
@@ -272,7 +272,7 @@
         // A field with no type and initializer or an instance field without
         // type and initializer need to have the type inferred.
         fieldType = new ImplicitFieldType(this, initializerToken);
-        libraryBuilder.registerImplicitlyTypedField(this);
+        type.registerInferable(this);
       }
     }
   }
@@ -379,7 +379,7 @@
 
   /// Builds the core AST structures for this field as needed for the outline.
   void build() {
-    if (type is! OmittedTypeBuilder) {
+    if (type is! InferableTypeBuilder) {
       fieldType = type.build(libraryBuilder, TypeUse.fieldType);
     }
     _fieldEncoding.build(libraryBuilder, this);
@@ -459,6 +459,11 @@
     }
   }
 
+  @override
+  void inferTypes(TypeEnvironment typeEnvironment) {
+    inferType();
+  }
+
   DartType inferType() {
     if (fieldType is! ImplicitFieldType) {
       // We have already inferred a type.
diff --git a/pkg/front_end/lib/src/fasta/source/source_function_builder.dart b/pkg/front_end/lib/src/fasta/source/source_function_builder.dart
index b91c160..fe0eb20 100644
--- a/pkg/front_end/lib/src/fasta/source/source_function_builder.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_function_builder.dart
@@ -383,7 +383,7 @@
       function.namedParameters.clear();
       function.requiredParameterCount = 1;
     }
-    if (returnType is! OmittedTypeBuilder) {
+    if (returnType is! InferableTypeBuilder) {
       function.returnType =
           returnType.build(libraryBuilder, TypeUse.returnType);
     }
diff --git a/pkg/front_end/lib/src/fasta/source/source_library_builder.dart b/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
index 8dff630..25f5456 100644
--- a/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
@@ -219,8 +219,6 @@
   /// the error message is the corresponding value in the map.
   Map<String, String?>? unserializableExports;
 
-  List<SourceFieldBuilder>? _implicitlyTypedFields;
-
   /// The language version of this library as defined by the language version
   /// of the package it belongs to, if present, or the current language version
   /// otherwise.
@@ -1276,15 +1274,7 @@
         (library.problemsAsJson ??= <String>[])
             .addAll(part.library.problemsAsJson!);
       }
-      List<SourceFieldBuilder> partImplicitlyTypedFields = [];
-      part.collectImplicitlyTypedFields(partImplicitlyTypedFields);
-      if (partImplicitlyTypedFields.isNotEmpty) {
-        if (_implicitlyTypedFields == null) {
-          _implicitlyTypedFields = partImplicitlyTypedFields;
-        } else {
-          _implicitlyTypedFields!.addAll(partImplicitlyTypedFields);
-        }
-      }
+      part.collectInferableTypes(_inferableTypes!);
       if (library != part.library) {
         // Mark the part library as synthetic as it's not an actual library
         // (anymore).
@@ -1584,9 +1574,26 @@
     //addBuilder("Null", new NullTypeBuilder(const NullType(), this, -1), -1);
   }
 
-  OmittedTypeBuilder addInferableType() {
-    // TODO(johnniwinther): Register inferable types in a backlog.
-    return new OmittedTypeBuilder();
+  List<InferableTypeBuilder>? _inferableTypes = [];
+
+  InferableTypeBuilder addInferableType() {
+    assert(_inferableTypes != null, "Late creation of inferable type.");
+    InferableTypeBuilder typeBuilder = new InferableTypeBuilder();
+    _inferableTypes?.add(typeBuilder);
+    return typeBuilder;
+  }
+
+  void collectInferableTypes(List<InferableTypeBuilder> inferableTypes) {
+    Iterable<SourceLibraryBuilder>? patches = this.patchLibraries;
+    if (patches != null) {
+      for (SourceLibraryBuilder patchLibrary in patches) {
+        patchLibrary.collectInferableTypes(inferableTypes);
+      }
+    }
+    if (_inferableTypes != null) {
+      inferableTypes.addAll(_inferableTypes!);
+    }
+    _inferableTypes = null;
   }
 
   NamedTypeBuilder addNamedType(
@@ -4639,25 +4646,6 @@
     }
   }
 
-  void registerImplicitlyTypedField(SourceFieldBuilder fieldBuilder) {
-    (_implicitlyTypedFields ??= <SourceFieldBuilder>[]).add(fieldBuilder);
-  }
-
-  void collectImplicitlyTypedFields(
-      List<FieldBuilder> implicitlyTypedFieldBuilders) {
-    Iterable<SourceLibraryBuilder>? patches = this.patchLibraries;
-    if (patches != null) {
-      for (SourceLibraryBuilder patchLibrary in patches) {
-        patchLibrary.collectImplicitlyTypedFields(implicitlyTypedFieldBuilders);
-      }
-    }
-
-    if (_implicitlyTypedFields != null) {
-      implicitlyTypedFieldBuilders.addAll(_implicitlyTypedFields!);
-      _implicitlyTypedFields = null;
-    }
-  }
-
   void forEachExtensionInScope(void Function(ExtensionBuilder) f) {
     if (_extensionsInScope == null) {
       _extensionsInScope = <ExtensionBuilder>{};
diff --git a/pkg/front_end/lib/src/fasta/source/source_loader.dart b/pkg/front_end/lib/src/fasta/source/source_loader.dart
index 3787878..cb33439 100644
--- a/pkg/front_end/lib/src/fasta/source/source_loader.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_loader.dart
@@ -52,6 +52,7 @@
 import '../builder/member_builder.dart';
 import '../builder/modifier_builder.dart';
 import '../builder/named_type_builder.dart';
+import '../builder/omitted_type_builder.dart';
 import '../builder/prefix_builder.dart';
 import '../builder/procedure_builder.dart';
 import '../builder/type_alias_builder.dart';
@@ -1207,7 +1208,7 @@
     ProcedureBuilder builder = new SourceProcedureBuilder(
         /* metadata = */ null,
         /* modifier flags = */ 0,
-        libraryBuilder.addInferableType(),
+        const ImplicitTypeBuilder(),
         "debugExpr",
         /* type variables = */ null,
         /* formals = */ null,
@@ -2287,16 +2288,13 @@
     typeInferenceEngine.prepareTopLevel(coreTypes, hierarchy);
     membersBuilder.computeTypes();
 
-    List<SourceFieldBuilder> allImplicitlyTypedFields = [];
-    for (SourceLibraryBuilder library in sourceLibraryBuilders) {
-      library.collectImplicitlyTypedFields(allImplicitlyTypedFields);
+    List<InferableTypeBuilder> inferableTypes = [];
+    for (SourceLibraryBuilder libraryBuilder in sourceLibraryBuilders) {
+      libraryBuilder.collectInferableTypes(inferableTypes);
     }
 
-    for (int i = 0; i < allImplicitlyTypedFields.length; i++) {
-      // TODO(ahe): This can cause a crash for parts that failed to get
-      // included, see for example,
-      // tests/standalone_2/io/http_cookie_date_test.dart.
-      allImplicitlyTypedFields[i].inferType();
+    for (InferableTypeBuilder typeBuilder in inferableTypes) {
+      typeBuilder.inferType(typeInferenceEngine.typeSchemaEnvironment);
     }
 
     typeInferenceEngine.isTypeInferencePrepared = true;
diff --git a/pkg/front_end/test/spell_checking_list_code.txt b/pkg/front_end/test/spell_checking_list_code.txt
index 37bfea3..9dbe0f7 100644
--- a/pkg/front_end/test/spell_checking_list_code.txt
+++ b/pkg/front_end/test/spell_checking_list_code.txt
@@ -1406,6 +1406,7 @@
 trees
 tricky
 triggering
+triggers
 trips
 trivially
 ts
@@ -1450,6 +1451,7 @@
 unifier
 unifies
 unify
+uninferable
 uninhabited
 uninstantiable
 uninstantiated
diff --git a/runtime/tests/vm/vm.status b/runtime/tests/vm/vm.status
index c61949e..2d0f5db 100644
--- a/runtime/tests/vm/vm.status
+++ b/runtime/tests/vm/vm.status
@@ -47,7 +47,12 @@
 
 [ $arch == ia32 ]
 dart/disassemble_aot_test: SkipByDesign # IA32 does not support AOT.
+dart/regress32597_2_test: Pass, Slow # Uses --optimization-counter-threshold=10 without a kernel service snapshot.
+dart/regress38467_test: Pass, Slow # Uses --optimization-counter-threshold=10 without a kernel service snapshot.
+dart/type_casts_with_null_safety_autodetection_test: Pass, Slow # Uses --optimization-counter-threshold=10 without a kernel service snapshot.
 dart_2/disassemble_aot_test: SkipByDesign # IA32 does not support AOT.
+dart_2/regress32597_2_test: Pass, Slow # Uses --optimization-counter-threshold=10 without a kernel service snapshot.
+dart_2/regress38467_test: Pass, Slow # Uses --optimization-counter-threshold=10 without a kernel service snapshot.
 
 [ $builder_tag == asan ]
 dart/transferable_throws_oom_test: SkipByDesign # This test tries to allocate too much memory on purpose. Still dartbug.com/37188
@@ -188,9 +193,6 @@
 dart/transferable_test: Skip # This is performance test and somehow debug win ia32 bot's performance is unpredictable
 dart_2/transferable_test: Skip # This is performance test and somehow debug win ia32 bot's performance is unpredictable
 
-[ $arch == ia32 && ($nnbd == strong || $nnbd == weak) ]
-dart/type_casts_with_null_safety_autodetection_test: Pass, Slow # Uses --optimization-counter-threshold=10 without a kernel service snapshot.
-
 [ $arch != simarm && $arch != simarm64 && $arch != simarm64c && $arch != simriscv32 && $arch != simriscv64 && $compiler == dartk && $hot_reload ]
 dart/data_uri_import_test/base64: Crash
 dart/data_uri_import_test/nocharset: Crash
diff --git a/tools/VERSION b/tools/VERSION
index b3753a6..c47b85e 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
 MAJOR 2
 MINOR 18
 PATCH 0
-PRERELEASE 167
+PRERELEASE 168
 PRERELEASE_PATCH 0
\ No newline at end of file