-
Notifications
You must be signed in to change notification settings - Fork 21
NoSuchMethodError for field accessor of local class #10856
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
Milestone
Comments
LPTK
added a commit
to epfldata/squid
that referenced
this issue
Apr 30, 2018
The main difficulties in porting the code base to 2.12 were: * two compiler bugs introduced by Scala 2.12, reported at: - scala/bug#10856 - scala/bug#10857 * the limitations of Scala runtime reflection with respect to the new encoding of function values (Java 8 lambdas), which affected Squid’s reflection-based interpreter * a subtle change in the behavior of Scala’s reify{} used by Scalatest, which produced an extruded variable when used inside invocations of Squid’s rewrite macro
LPTK
added a commit
to epfldata/squid
that referenced
this issue
Apr 30, 2018
The main difficulties in porting the code base to 2.12 were: * two compiler bugs introduced by Scala 2.12, reported at: - scala/bug#10856 - scala/bug#10857 * the limitations of Scala runtime reflection with respect to the new encoding of function values (Java 8 lambdas), which affected Squid’s reflection-based interpreter * a subtle change in the behavior of Scala’s reify{} used by Scalatest, which produced an extruded variable when used inside invocations of Squid’s rewrite macro
This can be simplified to some more basic types: def f[A](v: A) = x => {
(new Function1[A, A] {
val u = v
override def apply(x: A) = u
}).apply(x)
}
f("")("a") And the eerie thing is that adding a type signature fixes it: def f[A](v: A): A => A = ??? |
hrhino
added a commit
to hrhino/scala
that referenced
this issue
Oct 10, 2019
Fixed in scala/scala@9614c3a. Closes scala/bug#10856.
lrytz
added a commit
to scala/scala
that referenced
this issue
Oct 11, 2019
Test case for scala/bug#10856
Fixed by scala/scala@9614c3a / scala/scala#7340 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following code generates a
NoSuchMethodError
at runtime when using Scala 2.12 but not when using Scala 2.11:Here is the crash reproduced in the REPL:
The text was updated successfully, but these errors were encountered: