Skip to content

LambdaLift lifts methods that access private fields too far #514

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

Closed
DarkDimius opened this issue Apr 30, 2015 · 2 comments
Closed

LambdaLift lifts methods that access private fields too far #514

DarkDimius opened this issue Apr 30, 2015 · 2 comments

Comments

@DarkDimius
Copy link
Contributor

Contexts.Context.printCreationTraces has a lambda inside, that accesses a private accessor creationTrace of Contexts.Context.
LambdaLift lifts it out to a static method in Contexts, without setting a NotJavaPrivate on the private accessor of the creationTrace.

Manifests itself with such error:

Exception in thread "main" java.lang.VerifyError: Bad invokespecial instruction: current class isn't assignable to reference class.
Exception Details:
  Location:
    dotty/tools/dotc/core/Contexts$.$anonfun$printCreationTraces$2(Ldotty/tools/dotc/core/Contexts$$Context;)V @50: invokespecial
  Reason:
    Error exists in the bytecode
@DarkDimius
Copy link
Contributor Author

@odersky If you decide that you can lift method to be static, why make it static on top-level class, instead of making it static on the class that was the original owner?

@odersky
Copy link
Contributor

odersky commented May 3, 2015

Addressed by #517

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants