We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
scala> def foo[B](f: (=> Int) => B): Option[B] = ??? foo: [B](f: (=> Int) => B)Option[B] scala> def b = foo(identity) b: Option[=> Int] scala> def b = foo(identity(_)) b: Option[Int]
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-7899?orig=1 Reporter: @retronym Affected Versions: 2.10.0
Sorry, something went wrong.
@retronym said (edited on Oct 7, 2013 9:09:41 AM UTC): This leads to ClassCastExceptions:
scala> def foo[B](f: (=> Int) => B): () => B = () => f(0) foo: [B](f: (=> Int) => B)() => B scala> def b = foo(identity(_)) b: () => Int scala> def b = foo(identity) b: () => => Int scala> foo(identity)() java.lang.ClassCastException: $anonfun$foo$1$$anonfun$apply$1 cannot be cast to java.lang.Integer at scala.runtime.BoxesRunTime.unboxToInt(BoxesRunTime.java:106)
@retronym said: WIP: https://github.com/retronym/scala/compare/ticket;7899?expand=1
That branch would turn the errant case into a type error.
https://scala-webapps.epfl.ch/jenkins/job/scala-checkin-manual/1016/console
@retronym said: scala/scala#3022
@retronym said: I've moved this change behind -Xstict-inference to avoid the regression in Scala Free: scala/scala#3034.
Hopefully this will be a temporary measure.
retronym
No branches or pull requests
The text was updated successfully, but these errors were encountered: