-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug that resulted in false positive error when calling the same…
… generic function with a ParamSpec multiple times as separate arguments within a call expression. This addresses #5453.
- Loading branch information
1 parent
c41bc9c
commit 3a34332
Showing
3 changed files
with
58 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
packages/pyright-internal/src/tests/samples/paramSpec45.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# This sample tests the case where the same function that uses a ParamSpec | ||
# is called multiple times as arguments to the same call. | ||
|
||
from typing import Callable, ParamSpec | ||
|
||
P = ParamSpec("P") | ||
|
||
|
||
def func1(func: Callable[P, object], *args: P.args, **kwargs: P.kwargs) -> object: | ||
... | ||
|
||
|
||
def func2(x: str) -> int: | ||
... | ||
|
||
|
||
def func3(y: str) -> int: | ||
... | ||
|
||
|
||
print(func1(func2, x="..."), func1(func3, y="...")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters