-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Bad symbol is selected leading to ClassCastException. Regression from scala 2.13 #19711
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
Comments
minimized a bit further, class Foo(val s: Any):
def this(s: String) =
this(0)
class Bar(s: String) extends Foo(s):
def foo = s
Bar("").foo
java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.String |
To qualify as a super-parameter alias, a parameter of a subclass has to be passed to the primary constructor of the superclass. Fixes scala#19711
How I fixed it: |
To qualify as a super-parameter alias, a parameter of a subclass has to be passed to the primary constructor of the superclass. Fixes #19711
Compiler version
Scala 3.3.2 (3.4.0 also affected)
Minimized code
https://scastie.scala-lang.org/YdGomTp2S0Sc48M47mXLEA
Output
Expectation
That code compiles and runs without crashing (like in scala 2.13)
The text was updated successfully, but these errors were encountered: