Skip to content

Commit 75e0a26

Browse files
committed
add tests
1 parent c903b30 commit 75e0a26

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

test-data/unit/check-expressions.test

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2600,3 +2600,20 @@ f(random=[1,2,3]) # E: Unexpected keyword argument "random" for overloaded funct
26002600
# N: Possible overload variants: \
26012601
# N: def f(foobar: int) -> None \
26022602
# N: def f(foobar: str) -> None
2603+
2604+
f(fobar=1, baz=2) # E: Unexpected keyword argument "fobar" for overloaded function "f"; did you mean "foobar"? \
2605+
# E: Unexpected keyword argument "baz" for overloaded function "f"
2606+
2607+
f(foobar=1, invalid=2) # E: Unexpected keyword argument "invalid" for overloaded function "f"
2608+
2609+
@overload
2610+
def g(x: int, y: int) -> int: ...
2611+
2612+
@overload
2613+
def g(x: str, y: str) -> str: ...
2614+
2615+
def g(x: Union[int, str], y: Union[int, str]) -> Union[int, str]:
2616+
return x
2617+
2618+
g([1, 2], z=3) # E: Unexpected keyword argument "z" for overloaded function "g"
2619+
[builtins fixtures/list.pyi]

0 commit comments

Comments
 (0)