Skip to content

Commit e221e46

Browse files
committed
add test testDeprecatedClassInCast
1 parent a03f318 commit e221e46

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test-data/unit/check-deprecated.test

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,21 @@ class E(Generic[V]): ...
186186
[builtins fixtures/tuple.pyi]
187187

188188

189+
[case testDeprecatedClassInCast]
190+
191+
from typing import cast, Generic
192+
from typing_extensions import deprecated
193+
194+
class B: ...
195+
@deprecated("use C2 instead")
196+
class C: ...
197+
198+
c = C() # N: class __main__.C is deprecated: use C2 instead
199+
b = cast(B, c)
200+
201+
[builtins fixtures/tuple.pyi]
202+
203+
189204
[case testDeprecatedInstanceInFunctionDefinition]
190205

191206
from typing import Generic, List, Optional, TypeVar

0 commit comments

Comments
 (0)