Fixed regression in lambda type inference that produced false positive errors in some cases.

This commit is contained in:
Eric Traut 2022-01-22 19:00:51 -08:00
parent 06d20c40c6
commit 494720e6b3

View File

@ -12136,9 +12136,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions
node.parameters.forEach((param, index) => {
let paramType: Type = UnknownType.create();
if (expectedFunctionType && index < expectedFunctionType.details.parameters.length) {
paramType = makeTopLevelTypeVarsConcrete(
FunctionType.getEffectiveParameterType(expectedFunctionType, index)
);
paramType = FunctionType.getEffectiveParameterType(expectedFunctionType, index);
if (isTypeVar(paramType) && paramType.details.boundType) {
paramType = makeTopLevelTypeVarsConcrete(paramType);
}
}
if (param.name) {