Skip to content

Commit 77b9fe7

Browse files
committed
Test generic class as well
1 parent 2285e91 commit 77b9fe7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test-data/unit/check-classes.test

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8781,8 +8781,19 @@ C().bar = "fine"
87818781
[builtins fixtures/property.pyi]
87828782

87838783
[case testCorrectConstructorTypeWithAnyFallback]
8784+
from typing import Generic, TypeVar
8785+
87848786
class B(Unknown): # type: ignore
87858787
def __init__(self) -> None: ...
87868788
class C(B): ...
87878789

87888790
reveal_type(C) # N: Revealed type is "def () -> __main__.C"
8791+
8792+
T = TypeVar("T")
8793+
class BG(Generic[T], Unknown): # type: ignore
8794+
def __init__(self) -> None: ...
8795+
class CGI(BG[int]): ...
8796+
class CGT(BG[T]): ...
8797+
8798+
reveal_type(CGI) # N: Revealed type is "def () -> __main__.CGI"
8799+
reveal_type(CGT) # N: Revealed type is "def [T] () -> __main__.CGT[T`1]"

0 commit comments

Comments
 (0)