mirror of
https://github.com/microsoft/pyright.git
synced 2024-09-11 16:06:39 +03:00
Fixed regression in lambda type inference that produced false positive errors in some cases.
This commit is contained in:
parent
06d20c40c6
commit
494720e6b3
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user