You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
yeah this seems odd, if we create our own cast function we get the correct error:
fromtypingimportAny, TypeVar, castclassTest:
a: intt=Test()
_T=TypeVar("_T")
defcast2(typ: type[_T], val: Any) ->_T:
...
cast2(t.a, int) # error: Argument 1 to "cast2" has incompatible type "int"; expected "Type[<nothing>]" [arg-type]cast(t.a, int) # error: Name "t.a" is not defined
This leave me being like:
Till I realize that I got the args the wrong way around.
The text was updated successfully, but these errors were encountered: