-
Notifications
You must be signed in to change notification settings - Fork 21
Using 'lambda' in a method name triggers an assertion failure in the compiler #10857
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
Milestone
Comments
Seems like a manifestation of #2806. |
agree, I suggest this be a comment on #2806 and we close it here. |
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
Here is a self-contained, probably close to minimal reproduction: package test
class JSFunction
trait JSFunction0[+R] extends JSFunction {
def apply(): R
}
object A {
def lambdaAnything() = test(() => 1)
def test(cmp: JSFunction0[Int]) = ()
}
Reproducible with 2.12.15 and 2.13.8. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The bug looks very arcane, and I did not manage to reduce it to a simple self-contained example. Here is a permanent link to the place where the problematic method is defined, in my code base.
Try renaming
lamImpl
tolambdaImpl
. When compiling such code (withsbt compile
), an assertion is raised with the following message:The text was updated successfully, but these errors were encountered: