mirror of
https://github.com/microsoft/pyright.git
synced 2024-10-07 13:29:17 +03:00
Fixed false positive error when a generic class with a ParamSpec type parameter implements a descriptor protocol.
This commit is contained in:
parent
7fff1f89ad
commit
3d75f5b41a
@ -4530,11 +4530,16 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions
|
||||
boundMethodType &&
|
||||
(isFunction(boundMethodType) || isOverloadedFunction(boundMethodType))
|
||||
) {
|
||||
const typeVarMap = new TypeVarMap(getTypeVarScopeId(boundMethodType));
|
||||
if (bindToClass) {
|
||||
typeVarMap.addSolveForScope(getTypeVarScopeId(bindToClass));
|
||||
}
|
||||
|
||||
const callResult = validateCallArguments(
|
||||
errorNode,
|
||||
argList,
|
||||
boundMethodType,
|
||||
/* typeVarMap */ undefined,
|
||||
typeVarMap,
|
||||
/* skipUnknownArgCheck */ true
|
||||
);
|
||||
|
||||
|
@ -72,4 +72,4 @@ class B:
|
||||
|
||||
b = B()
|
||||
t_b1: Literal["str"] = reveal_type(b.foo)
|
||||
t_b2: Literal["Minimal[~B, str]"] = reveal_type(B.foo)
|
||||
t_b2: Literal["Minimal[B, str]"] = reveal_type(B.foo)
|
||||
|
Loading…
Reference in New Issue
Block a user