Fix nomenclature around upwards/downwards/partial inference to match spec.
The spec uses the terms "upwards" vs "downwards" inference to refer to
whether type constraints come from a return type or parameter types.
Previous to this change the code used the terms "upwards" vs "partial"
inference to refer to whether the types being chosen were preliminary
(and hence might contain `?`s) or were the final inferred types. This
led to confusion; for example the method
`downwardInferObjectPatternRequiredType` was calling `upwardsInfer`.
This change adjusts the nomenclature so that the methods that choose
types are called `choosePreliminaryTypes` and `chooseFinalTypes`, to
avoid any confusion with the direction of inference.
See discussion here:
https://dart-review.googlesource.com/c/sdk/+/290613/comment/894a767c_e269584e/.
Change-Id: Ie05dcae027ca82b2ce7e5a57f1846412d5b32d50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290901
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
diff --git a/pkg/analyzer/lib/src/dart/element/generic_inferrer.dart b/pkg/analyzer/lib/src/dart/element/generic_inferrer.dart
index b857fa9..2abc66c 100644
--- a/pkg/analyzer/lib/src/dart/element/generic_inferrer.dart
+++ b/pkg/analyzer/lib/src/dart/element/generic_inferrer.dart
@@ -112,6 +112,14 @@
TypeProviderImpl get typeProvider => _typeSystem.typeProvider;
+ /// Performs upwards inference, producing a final set of inferred types that
+ /// does not contain references to the "unknown type".
+ List<DartType> chooseFinalTypes() => tryChooseFinalTypes(failAtError: false)!;
+
+ /// Performs partial (either downwards or horizontal) inference, producing a
+ /// set of inferred types that may contain references to the "unknown type".
+ List<DartType> choosePreliminaryTypes() => _chooseTypes(preliminary: true);
+
/// Apply an argument constraint, which asserts that the [argument] staticType
/// is a subtype of the [parameterType].
void constrainArgument(
@@ -177,15 +185,11 @@
_tryMatchSubtypeOf(declaredType, contextType, origin, covariant: true);
}
- /// Performs partial (either downwards or horizontal) inference, producing a
- /// set of inferred types that may contain references to the "unknown type".
- List<DartType> partialInfer() => _chooseTypes(partial: true);
-
- /// Same as [upwardsInfer], but if [failAtError] is `true` (the default) and
- /// inference fails, returns `null` rather than trying to perform error
+ /// Same as [chooseFinalTypes], but if [failAtError] is `true` (the default)
+ /// and inference fails, returns `null` rather than trying to perform error
/// recovery.
- List<DartType>? tryUpwardsInfer({bool failAtError = true}) {
- var inferredTypes = _chooseTypes(partial: false);
+ List<DartType>? tryChooseFinalTypes({bool failAtError = true}) {
+ var inferredTypes = _chooseTypes(preliminary: false);
// Check the inferred types against all of the constraints.
var knownTypes = <TypeParameterElement, DartType>{};
var hasErrorReported = false;
@@ -298,10 +302,6 @@
return result;
}
- /// Performs upwards inference, producing a final set of inferred types that
- /// does not contain references to the "unknown type".
- List<DartType> upwardsInfer() => tryUpwardsInfer(failAtError: false)!;
-
/// Check that inferred [typeArguments] satisfy the [typeParameters] bounds.
void _checkArgumentsNotMatchingBounds({
required AstNode? errorNode,
@@ -423,7 +423,7 @@
/// Computes (or recomputes) a set of [inferredTypes] based on the constraints
/// that have been recorded so far.
- List<DartType> _chooseTypes({required bool partial}) {
+ List<DartType> _chooseTypes({required bool preliminary}) {
var inferredTypes = List<DartType>.filled(
_typeFormals.length, UnknownInferredType.instance);
for (int i = 0; i < _typeFormals.length; i++) {
@@ -445,7 +445,7 @@
var previouslyInferredType = _typesInferredSoFar[typeParam];
if (previouslyInferredType != null) {
inferredTypes[i] = previouslyInferredType;
- } else if (partial) {
+ } else if (preliminary) {
var inferredType = _inferTypeParameterFromContext(
constraints, extendsClause,
isContravariant: typeParam.variance.isContravariant);
diff --git a/pkg/analyzer/lib/src/dart/element/type_system.dart b/pkg/analyzer/lib/src/dart/element/type_system.dart
index 3adb6dc..94495a9 100644
--- a/pkg/analyzer/lib/src/dart/element/type_system.dart
+++ b/pkg/analyzer/lib/src/dart/element/type_system.dart
@@ -536,7 +536,7 @@
inferrer.constrainGenericFunctionInContext(fnType, contextType);
// Infer and instantiate the resulting type.
- return inferrer.upwardsInfer();
+ return inferrer.chooseFinalTypes();
}
@override
@@ -1345,7 +1345,7 @@
}
var inferredTypes = inferrer
- .upwardsInfer()
+ .chooseFinalTypes()
.map(_removeBoundsOfGenericFunctionTypes)
.toFixedList();
var substitution = Substitution.fromPairs(typeParameters, inferredTypes);
diff --git a/pkg/analyzer/lib/src/dart/resolver/applicable_extensions.dart b/pkg/analyzer/lib/src/dart/resolver/applicable_extensions.dart
index bf399a3..26a1072 100644
--- a/pkg/analyzer/lib/src/dart/resolver/applicable_extensions.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/applicable_extensions.dart
@@ -201,7 +201,7 @@
rawExtendedType,
'extendedType',
);
- var inferredTypes = inferrer.tryUpwardsInfer();
+ var inferredTypes = inferrer.tryChooseFinalTypes();
if (inferredTypes == null) {
continue;
}
diff --git a/pkg/analyzer/lib/src/dart/resolver/extension_member_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/extension_member_resolver.dart
index 6dd7018..5ffa72b 100644
--- a/pkg/analyzer/lib/src/dart/resolver/extension_member_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/extension_member_resolver.dart
@@ -352,7 +352,7 @@
element.extendedType,
'extendedType',
);
- return inferrer.upwardsInfer();
+ return inferrer.chooseFinalTypes();
}
}
diff --git a/pkg/analyzer/lib/src/dart/resolver/invocation_inferrer.dart b/pkg/analyzer/lib/src/dart/resolver/invocation_inferrer.dart
index a1dabaa..15517d0 100644
--- a/pkg/analyzer/lib/src/dart/resolver/invocation_inferrer.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/invocation_inferrer.dart
@@ -199,8 +199,8 @@
genericMetadataIsEnabled: resolver.genericMetadataIsEnabled,
);
- substitution =
- Substitution.fromPairs(rawType.typeFormals, inferrer.partialInfer());
+ substitution = Substitution.fromPairs(
+ rawType.typeFormals, inferrer.choosePreliminaryTypes());
}
List<EqualityInfo<DartType>?>? identicalInfo = _isIdentical ? [] : null;
@@ -221,7 +221,7 @@
.planReconciliationStages()) {
if (inferrer != null && !isFirstStage) {
substitution = Substitution.fromPairs(
- rawType!.typeFormals, inferrer.partialInfer());
+ rawType!.typeFormals, inferrer.choosePreliminaryTypes());
}
_resolveDeferredFunctionLiterals(
deferredFunctionLiterals: stage,
@@ -233,7 +233,7 @@
}
if (inferrer != null) {
- typeArgumentTypes = inferrer.upwardsInfer();
+ typeArgumentTypes = inferrer.chooseFinalTypes();
}
FunctionType? invokeType = typeArgumentTypes != null
? rawType?.instantiate(typeArgumentTypes)
diff --git a/pkg/analyzer/lib/src/dart/resolver/named_type_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/named_type_resolver.dart
index dc6fd3f..6657de4 100644
--- a/pkg/analyzer/lib/src/dart/resolver/named_type_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/named_type_resolver.dart
@@ -181,7 +181,7 @@
contextReturnType: enclosingClass!.thisType,
genericMetadataIsEnabled: _genericMetadataIsEnabled,
);
- var typeArguments = inferrer.upwardsInfer();
+ var typeArguments = inferrer.chooseFinalTypes();
return element.instantiate(
typeArguments: typeArguments,
nullabilitySuffix: _noneOrStarSuffix,
diff --git a/pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart
index e9ef959..de27813 100644
--- a/pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart
@@ -108,7 +108,7 @@
} else {
inferrer = _inferListTypeDownwards(node, contextType: contextType);
if (contextType is! UnknownInferredType) {
- var typeArguments = inferrer.partialInfer();
+ var typeArguments = inferrer.choosePreliminaryTypes();
listType = _typeProvider.listElement.instantiate(
typeArguments: typeArguments, nullabilitySuffix: _noneOrStarSuffix);
}
@@ -142,7 +142,7 @@
} else {
inferrer = _inferSetTypeDownwards(node, literalResolution.contextType);
if (literalResolution.contextType != null) {
- var typeArguments = inferrer.partialInfer();
+ var typeArguments = inferrer.choosePreliminaryTypes();
literalType = _typeProvider.setElement.instantiate(
typeArguments: typeArguments,
nullabilitySuffix: _noneOrStarSuffix);
@@ -156,7 +156,7 @@
} else {
inferrer = _inferMapTypeDownwards(node, literalResolution.contextType);
if (literalResolution.contextType != null) {
- var typeArguments = inferrer.partialInfer();
+ var typeArguments = inferrer.choosePreliminaryTypes();
literalType = _typeProvider.mapElement.instantiate(
typeArguments: typeArguments,
nullabilitySuffix: _noneOrStarSuffix);
@@ -499,7 +499,7 @@
inferrer.constrainArguments(
parameters: parameters, argumentTypes: elementTypes);
- var typeArguments = inferrer.upwardsInfer();
+ var typeArguments = inferrer.chooseFinalTypes();
return element.instantiate(
typeArguments: typeArguments,
nullabilitySuffix: _noneOrStarSuffix,
@@ -742,7 +742,7 @@
parameters: parameters,
argumentTypes: argumentTypes,
);
- var typeArguments = inferrer.upwardsInfer();
+ var typeArguments = inferrer.chooseFinalTypes();
return element.instantiate(
typeArguments: typeArguments,
nullabilitySuffix: _noneOrStarSuffix,
@@ -776,7 +776,7 @@
}
inferrer.constrainArguments(
parameters: parameters, argumentTypes: argumentTypes);
- var typeArguments = inferrer.upwardsInfer();
+ var typeArguments = inferrer.chooseFinalTypes();
return element.instantiate(
typeArguments: typeArguments, nullabilitySuffix: _noneOrStarSuffix);
}
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 4f1ffad..8227aea 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -3676,7 +3676,7 @@
genericMetadataIsEnabled: genericMetadataIsEnabled,
);
inferrer.constrainReturnType(declaredType, contextType);
- return inferrer.upwardsInfer();
+ return inferrer.chooseFinalTypes();
}
/// If `expression` should be treated as `expression.call`, inserts an
diff --git a/pkg/analyzer/test/src/dart/element/generic_inferrer_test.dart b/pkg/analyzer/test/src/dart/element/generic_inferrer_test.dart
index c5668a5..1e9ac41 100644
--- a/pkg/analyzer/test/src/dart/element/generic_inferrer_test.dart
+++ b/pkg/analyzer/test/src/dart/element/generic_inferrer_test.dart
@@ -658,7 +658,7 @@
);
inferrer.constrainArguments(
parameters: ft.parameters, argumentTypes: arguments);
- var typeArguments = inferrer.upwardsInfer();
+ var typeArguments = inferrer.chooseFinalTypes();
if (expectError) {
expect(listener.errors.map((e) => e.errorCode).toList(),
diff --git a/pkg/front_end/lib/src/fasta/type_inference/inference_visitor.dart b/pkg/front_end/lib/src/fasta/type_inference/inference_visitor.dart
index 4b3243d..3fb0fd3 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/inference_visitor.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/inference_visitor.dart
@@ -2580,7 +2580,7 @@
listType, listClass.typeParameters, typeContext,
isNonNullableByDefault: isNonNullableByDefault,
isConst: node.isConst);
- inferredTypes = typeSchemaEnvironment.partialInfer(
+ inferredTypes = typeSchemaEnvironment.choosePreliminaryTypes(
gatherer, listClass.typeParameters, null,
isNonNullableByDefault: isNonNullableByDefault);
inferredTypeArgument = inferredTypes[0];
@@ -2598,7 +2598,7 @@
}
if (inferenceNeeded) {
gatherer!.constrainArguments(formalTypes, actualTypes);
- inferredTypes = typeSchemaEnvironment.upwardsInfer(
+ inferredTypes = typeSchemaEnvironment.chooseFinalTypes(
gatherer, listClass.typeParameters, inferredTypes!,
isNonNullableByDefault: isNonNullableByDefault);
if (dataForTesting != null) {
@@ -4614,7 +4614,7 @@
mapType, mapClass.typeParameters, typeContext,
isNonNullableByDefault: isNonNullableByDefault,
isConst: node.isConst);
- inferredTypes = typeSchemaEnvironment.partialInfer(
+ inferredTypes = typeSchemaEnvironment.choosePreliminaryTypes(
gatherer, mapClass.typeParameters, null,
isNonNullableByDefault: isNonNullableByDefault);
inferredKeyType = inferredTypes[0];
@@ -4687,11 +4687,12 @@
setType, coreTypes.setClass.typeParameters, typeContext,
isNonNullableByDefault: isNonNullableByDefault,
isConst: node.isConst);
- List<DartType> inferredTypesForSet = typeSchemaEnvironment.partialInfer(
- gatherer, coreTypes.setClass.typeParameters, null,
- isNonNullableByDefault: isNonNullableByDefault);
+ List<DartType> inferredTypesForSet =
+ typeSchemaEnvironment.choosePreliminaryTypes(
+ gatherer, coreTypes.setClass.typeParameters, null,
+ isNonNullableByDefault: isNonNullableByDefault);
gatherer.constrainArguments(formalTypesForSet, actualTypesForSet);
- inferredTypesForSet = typeSchemaEnvironment.upwardsInfer(
+ inferredTypesForSet = typeSchemaEnvironment.chooseFinalTypes(
gatherer, coreTypes.setClass.typeParameters, inferredTypesForSet,
isNonNullableByDefault: isNonNullableByDefault);
DartType inferredTypeArgument = inferredTypesForSet[0];
@@ -4731,7 +4732,7 @@
NeverType.fromNullability(libraryBuilder.nonNullable), replacement);
}
gatherer!.constrainArguments(formalTypes, actualTypes);
- inferredTypes = typeSchemaEnvironment.upwardsInfer(
+ inferredTypes = typeSchemaEnvironment.chooseFinalTypes(
gatherer, mapClass.typeParameters, inferredTypes!,
isNonNullableByDefault: isNonNullableByDefault);
if (dataForTesting != null) {
@@ -7899,7 +7900,7 @@
setType, setClass.typeParameters, typeContext,
isNonNullableByDefault: isNonNullableByDefault,
isConst: node.isConst);
- inferredTypes = typeSchemaEnvironment.partialInfer(
+ inferredTypes = typeSchemaEnvironment.choosePreliminaryTypes(
gatherer, setClass.typeParameters, null,
isNonNullableByDefault: isNonNullableByDefault);
inferredTypeArgument = inferredTypes[0];
@@ -7918,7 +7919,7 @@
if (inferenceNeeded) {
gatherer!.constrainArguments(formalTypes, actualTypes);
- inferredTypes = typeSchemaEnvironment.upwardsInfer(
+ inferredTypes = typeSchemaEnvironment.chooseFinalTypes(
gatherer, setClass.typeParameters, inferredTypes!,
isNonNullableByDefault: isNonNullableByDefault);
if (dataForTesting != null) {
@@ -10914,7 +10915,8 @@
TypeConstraintGatherer gatherer = typeSchemaEnvironment
.setupGenericTypeInference(declaredType, typeParameters, contextType,
isNonNullableByDefault: isNonNullableByDefault);
- return typeSchemaEnvironment.upwardsInfer(gatherer, typeParameters, null,
+ return typeSchemaEnvironment.chooseFinalTypes(
+ gatherer, typeParameters, null,
isNonNullableByDefault: isNonNullableByDefault);
}
diff --git a/pkg/front_end/lib/src/fasta/type_inference/inference_visitor_base.dart b/pkg/front_end/lib/src/fasta/type_inference/inference_visitor_base.dart
index 1dcd086..6082599 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/inference_visitor_base.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/inference_visitor_base.dart
@@ -969,7 +969,7 @@
.setupGenericTypeInference(null, typeParameters, null,
isNonNullableByDefault: libraryBuilder.isNonNullableByDefault);
gatherer.constrainArguments([onType], [receiverType]);
- inferredTypes = typeSchemaEnvironment.upwardsInfer(
+ inferredTypes = typeSchemaEnvironment.chooseFinalTypes(
gatherer, typeParameters, inferredTypes,
isNonNullableByDefault: isNonNullableByDefault);
return inferredTypes;
@@ -1829,7 +1829,7 @@
calleeTypeParameters,
typeContext,
isNonNullableByDefault: isNonNullableByDefault);
- inferredTypes = typeSchemaEnvironment.partialInfer(
+ inferredTypes = typeSchemaEnvironment.choosePreliminaryTypes(
gatherer, calleeTypeParameters, null,
isNonNullableByDefault: isNonNullableByDefault);
substitution =
@@ -2006,7 +2006,7 @@
: const [])
.planReconciliationStages()) {
if (gatherer != null && !isFirstStage) {
- inferredTypes = typeSchemaEnvironment.partialInfer(
+ inferredTypes = typeSchemaEnvironment.choosePreliminaryTypes(
gatherer, calleeTypeParameters, inferredTypes,
isNonNullableByDefault: isNonNullableByDefault);
substitution =
@@ -2113,7 +2113,7 @@
}
if (inferenceNeeded) {
- inferredTypes = typeSchemaEnvironment.upwardsInfer(
+ inferredTypes = typeSchemaEnvironment.chooseFinalTypes(
gatherer!, calleeTypeParameters, inferredTypes!,
isNonNullableByDefault: isNonNullableByDefault);
assert(inferredTypes.every((type) => isKnown(type)),
@@ -3699,7 +3699,7 @@
typeSchemaEnvironment.setupGenericTypeInference(
instantiatedType, typeParameters, context,
isNonNullableByDefault: isNonNullableByDefault);
- inferredTypes = typeSchemaEnvironment.upwardsInfer(
+ inferredTypes = typeSchemaEnvironment.chooseFinalTypes(
gatherer, typeParameters, inferredTypes,
isNonNullableByDefault: isNonNullableByDefault);
Substitution substitution =
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart b/pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart
index 9959b7c4..cef0a06 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart
@@ -123,13 +123,13 @@
/// Performs partial (either downwards or horizontal) inference, producing a
/// set of inferred types that may contain references to the "unknown type".
- List<DartType> partialInfer(
+ List<DartType> choosePreliminaryTypes(
TypeConstraintGatherer gatherer,
List<TypeParameter> typeParametersToInfer,
List<DartType>? previouslyInferredTypes,
{required bool isNonNullableByDefault}) =>
_chooseTypes(gatherer, typeParametersToInfer, previouslyInferredTypes,
- isNonNullableByDefault: isNonNullableByDefault, partial: true);
+ isNonNullableByDefault: isNonNullableByDefault, preliminary: true);
@override
DartType getTypeOfSpecialCasedBinaryOperator(DartType type1, DartType type2,
@@ -251,17 +251,18 @@
/// of types inferred by the last call to this method; it should be a list of
/// the same length.
///
- /// If [partial] is `true`, then we not in the final pass of inference. This
- /// means we are allowed to return `?` to precisely represent an unknown type.
+ /// If [preliminary] is `true`, then we not in the final pass of inference.
+ /// This means we are allowed to return `?` to precisely represent an unknown
+ /// type.
///
- /// If [partial] is `false`, then we are in the final pass of inference, and
- /// must not conclude `?` for any type formal.
+ /// If [preliminary] is `false`, then we are in the final pass of inference,
+ /// and must not conclude `?` for any type formal.
List<DartType> inferTypeFromConstraints(
Map<TypeParameter, TypeConstraint> constraints,
List<TypeParameter> typeParametersToInfer,
List<DartType>? previouslyInferredTypes,
{required bool isNonNullableByDefault,
- bool partial = false}) {
+ bool preliminary = false}) {
List<DartType> inferredTypes =
previouslyInferredTypes?.toList(growable: false) ??
new List.filled(typeParametersToInfer.length, const UnknownType());
@@ -278,7 +279,7 @@
}
TypeConstraint constraint = constraints[typeParam]!;
- if (partial) {
+ if (preliminary) {
inferredTypes[i] = _inferTypeParameterFromContext(
previouslyInferredTypes?[i], constraint, extendsConstraint,
isNonNullableByDefault: isNonNullableByDefault,
@@ -292,7 +293,7 @@
}
}
- if (!partial) {
+ if (!preliminary) {
assert(typeParametersToInfer.length == inferredTypes.length);
FreshTypeParameters freshTypeParameters =
getFreshTypeParameters(typeParametersToInfer);
@@ -493,13 +494,13 @@
/// Performs upwards inference, producing a final set of inferred types that
/// does not contain references to the "unknown type".
- List<DartType> upwardsInfer(
+ List<DartType> chooseFinalTypes(
TypeConstraintGatherer gatherer,
List<TypeParameter> typeParametersToInfer,
List<DartType>? previouslyInferredTypes,
{required bool isNonNullableByDefault}) =>
_chooseTypes(gatherer, typeParametersToInfer, previouslyInferredTypes,
- isNonNullableByDefault: isNonNullableByDefault, partial: false);
+ isNonNullableByDefault: isNonNullableByDefault, preliminary: false);
/// Computes (or recomputes) a set of [inferredTypes] based on the constraints
/// that have been recorded so far.
@@ -508,14 +509,14 @@
List<TypeParameter> typeParametersToInfer,
List<DartType>? previouslyInferredTypes,
{required bool isNonNullableByDefault,
- required bool partial}) {
+ required bool preliminary}) {
List<DartType> inferredTypes = inferTypeFromConstraints(
gatherer.computeConstraints(
isNonNullableByDefault: isNonNullableByDefault),
typeParametersToInfer,
previouslyInferredTypes,
isNonNullableByDefault: isNonNullableByDefault,
- partial: partial);
+ preliminary: preliminary);
for (int i = 0; i < inferredTypes.length; i++) {
inferredTypes[i] = demoteTypeInLibrary(inferredTypes[i],
diff --git a/pkg/front_end/test/fasta/type_inference/type_schema_environment_test_base.dart b/pkg/front_end/test/fasta/type_inference/type_schema_environment_test_base.dart
index 0c343b3..72f324f 100644
--- a/pkg/front_end/test/fasta/type_inference/type_schema_environment_test_base.dart
+++ b/pkg/front_end/test/fasta/type_inference/type_schema_environment_test_base.dart
@@ -171,12 +171,12 @@
returnContextTypeNode,
isNonNullableByDefault: isNonNullableByDefault);
if (formalTypeNodes == null) {
- inferredTypeNodes = typeSchemaEnvironment.partialInfer(
+ inferredTypeNodes = typeSchemaEnvironment.choosePreliminaryTypes(
gatherer, typeParameterNodesToInfer, inferredTypeNodes,
isNonNullableByDefault: isNonNullableByDefault);
} else {
gatherer.constrainArguments(formalTypeNodes, actualTypeNodes!);
- inferredTypeNodes = typeSchemaEnvironment.upwardsInfer(
+ inferredTypeNodes = typeSchemaEnvironment.chooseFinalTypes(
gatherer, typeParameterNodesToInfer, inferredTypeNodes!,
isNonNullableByDefault: isNonNullableByDefault);
}
@@ -215,7 +215,7 @@
[typeParameterNode],
inferredTypeNodes,
isNonNullableByDefault: isNonNullableByDefault,
- partial: downwardsInferPhase);
+ preliminary: downwardsInferPhase);
expect(inferredTypeNodes.single, expectedTypeNode);
});
diff --git a/pkg/front_end/test/spell_checking_list_code.txt b/pkg/front_end/test/spell_checking_list_code.txt
index 1764688..b9bcd2f 100644
--- a/pkg/front_end/test/spell_checking_list_code.txt
+++ b/pkg/front_end/test/spell_checking_list_code.txt
@@ -1095,6 +1095,7 @@
preexisting
preferably
prefixing
+preliminary
premark
preorder
prepares