mirror of
https://github.com/microsoft/pyright.git
synced 2024-10-06 12:57:14 +03:00
Fixed bug that results in a crash in very specific circumstances that involve binding a method parameterized by a function-scoped ParamSpec. This addresses #8823. (#8824)
This commit is contained in:
parent
020dea1381
commit
acc52c7420
@ -26700,9 +26700,18 @@ export function createTypeEvaluator(
|
||||
// evaluating (and caching) the inferred return type if there is no defined return type.
|
||||
getEffectiveReturnType(memberType);
|
||||
|
||||
const specializedFunction = solveAndApplyConstraints(memberType, constraints) as FunctionType;
|
||||
const specializedFunction = solveAndApplyConstraints(memberType, constraints);
|
||||
if (isFunction(specializedFunction)) {
|
||||
return FunctionType.clone(specializedFunction, stripFirstParam, baseType);
|
||||
}
|
||||
|
||||
return FunctionType.clone(specializedFunction, stripFirstParam, baseType);
|
||||
if (isOverloaded(specializedFunction)) {
|
||||
// For overloaded functions, use the first overload. This isn't
|
||||
// strictly correct, but this is an extreme edge case.
|
||||
return FunctionType.clone(OverloadedType.getOverloads(specializedFunction)[0], stripFirstParam, baseType);
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function isFinalVariable(symbol: Symbol): boolean {
|
||||
|
Loading…
Reference in New Issue
Block a user