Describe the Bug
from __future__ import annotations
class A[T]:
def __init__(self, value: T) -> None:
self.t: T = value
def f[Expected](self) -> A[Expected | T]:
return
_: A[object] = A(1).f() # no error, great
b = A(1).f()
b # A[int | Unknown]
i would expect b to be A[int]
additionally, if we add a default of Never to Expected, then the Unknown still doensn't go away
Sandbox Link
No response
(Only applicable for extension issues) IDE Information
No response
Describe the Bug
i would expect
bto beA[int]additionally, if we add a default of
NevertoExpected, then theUnknownstill doensn't go awaySandbox Link
No response
(Only applicable for extension issues) IDE Information
No response