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
Mypy is incoherent in the following code even though the only difference is the order of the isinstance checks. I know that Optional is the idiomatic mypy way to represent possibly missing values, but this is the smallest example I found that shows the problem.
Bug Report
Mypy is incoherent in the following code even though the only difference is the order of the
isinstance
checks. I know that Optional is the idiomatic mypy way to represent possibly missing values, but this is the smallest example I found that shows the problem.Expected Behavior
Either mypy finds an error in both functions or neither.
Actual Behavior
In the
ko
function, mypy finds this error for the last line:Argument 1 to "assert_never" has incompatible type "Just[int]"; expected "NoReturn"
If I use a concrete type instead of a generic one in the
Just
class no error is reported in both functions.Your Environment
mypy.ini
(and other config files): N/AThe text was updated successfully, but these errors were encountered: