We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
The following code crashes with a ClassCastException:
trait Common { case class Data(a: String) } object O1 extends Common object O2 extends Common val data = O2.Data("test") // Runtime error: java.lang.ClassCastException: O2$ cannot be cast to O1$ data match { case O1.Data(s) => println("O1 data") case O2.Data(s) => println("O2 data") case _ => println("Unknown") }
(Observed on 0.4.0-RC1)
The text was updated successfully, but these errors were encountered:
Dotty:
if (x1.$isInstanceOf$[Common.this.Data].&&(x1.asInstanceOf[Common.this.Data].1_<outer>.eq(Common.this))
Scalac:
if (x1.isInstanceOf[O1.Data].&&((x1.asInstanceOf[O1.Data]: O1.Data).<outer>.eq(O1)))
Here Dotty emits an invalid cast that throws at runtime:
if (data2 instanceof Common.Data && (O1$)data2.Common$Data$$$outer() == O1$.MODULE$)
if (data2 instanceof Common.Data && data2.Common$Data$$$outer() == O1$.MODULE$)
Sorry, something went wrong.
Fix scala#3548: set outer select type to be the type enclosing the ex…
a2361a9
…pected type Otherwise, ElimOuterSelect will insert `ensureConforms(tp)` in outer test, which causes run-time exeception.
7e138cc
Merge pull request #3551 from dotty-staging/fix-3548
f4abdd8
Fix #3548: set outer select type to be the type enclosing the expected type
liufengyun
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
The following code crashes with a ClassCastException:
(Observed on 0.4.0-RC1)
The text was updated successfully, but these errors were encountered: