Skip to content

Commit 863cabb

Browse files
authored
Add regression test for asserting distinct callable types (#15258)
Closes #15153. This issue was already addressed in #15184; we're adding a regression test.
1 parent af39755 commit 863cabb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test-data/unit/check-assert-type-fail.test

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,8 @@ class array:
2626
def f(si: arr.array[int]):
2727
typing.assert_type(si, int) # E: Expression is of type "array[int]", not "int"
2828
[builtins fixtures/tuple.pyi]
29+
30+
[case testAssertTypeFailCallableArgKind]
31+
from typing import assert_type, Callable
32+
def myfunc(arg: int) -> None: pass
33+
assert_type(myfunc, Callable[[int], None]) # E: Expression is of type "Callable[[Arg(int, 'arg')], None]", not "Callable[[int], None]"

0 commit comments

Comments
 (0)