To Reproduce
fromtypingimportTypeVarT=TypeVar("T")
deffun(x: T, klass: type) ->T:
ifnotisinstance(x, klass):
raiseTypeErrorreturnxExpected Behavior
No error.
Actual Behavior
error: Incompatible return value type (got "object", expected "T") [return-value]
Your Environment
To Reproduce
Expected Behavior
No error.
Actual Behavior
Your Environment