-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incompatible type of nothing in switch expression with object cases #2001
Comments
The problem here was that the type of the switch is these days My concern is that |
We only reify them when they are type args, and according to the spec such types are never inferred. Sent from my iPhone
|
Right. So when constructing a reified type argument I need to ensure I'm not using a
So does that mean this bug is a typechecker bug? |
@tombentley read again what I just wrote :) |
Hint: there are no type args in the above code! |
I assume that means it's not a typechecker bug, and we can expect to find this |
No, it's not a bug, and yes, the backend needs to be able to accommodate expressions with types like this. |
The error disappears if both cases evaluate to the same object (e. g.
case (1) smaller
); in that case, the compiler castsnothing
tosmaller_
.As always, generated code,
@noanno
’ed.The text was updated successfully, but these errors were encountered: