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
3.4.1
It is important to apply each of the definitions/expressions one by one, otherwise the exception is not reproducible.
scala> def g1(acc: Int)(h: (Int, Int) => Int): Int = h(acc, acc) // def g1(acc: Int)(h: (Int, Int) => Int): Int scala> def g2(acc: Int)(h: (=> Int, => Int) => Int): Int = h(acc, acc) // def g2(acc: => Int)(h: (=> Int, => Int) => Int): Int scala> g2(1)(_ + _) // java.lang.ClassCastException: class java.lang.Integer cannot be cast to class scala.Function0 (java.lang.Integer is in module // java.base of loader 'bootstrap'; scala.Function0 is in unnamed module of loader java.net.URLClassLoader @49798e84) // at scala.Function2.apply$mcIII$sp(Function2.scala:40) // at rs$line$2$.g2(rs$line$2:1) // ... 35 elided
The result should be 2, instead of a ClassCastException being thrown.
Related IntelliJ IDEA ticket: https://youtrack.jetbrains.com/issue/SCL-22382/ClassNotFoundException-when-running-a-Scala-3-worksheet
The text was updated successfully, but these errors were encountered:
otherwise the exception is not reproducible.
oh man, hate it when that happens.
Sorry, something went wrong.
Fixed in nightly builds by #19983
No branches or pull requests
Compiler version
3.4.1
Minimized code
It is important to apply each of the definitions/expressions one by one, otherwise the exception is not reproducible.
Expectation
The result should be 2, instead of a ClassCastException being thrown.
Related IntelliJ IDEA ticket: https://youtrack.jetbrains.com/issue/SCL-22382/ClassNotFoundException-when-running-a-Scala-3-worksheet
The text was updated successfully, but these errors were encountered: