-
Notifications
You must be signed in to change notification settings - Fork 1.1k
enum branches can extend any class #6601
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
Labels
Comments
Actually you can extend anything at all |
class Foo
enum Var[G, A] with
case Z[A, G]() extends Foo
val isVar = Var.Z().isInstanceOf[Var[?,?]] // false
val isEnum = Var.Z().isInstanceOf[scala.Enum] // false |
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
Mar 5, 2020
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
Mar 5, 2020
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
Mar 5, 2020
bishabosha
added a commit
that referenced
this issue
Mar 5, 2020
Fix #6601: Check that an enum case extends its enum class
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Noticed by accident that enum cases might extend the wrong enum. That is,
Z
below is accepted and should probably be rejected. I also confirmed thatZ
indeed extendsExpr
and notVar
.The text was updated successfully, but these errors were encountered: