Skip to content
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

Verify error with self-referential lambda #43

Closed
dalewking opened this issue Jan 31, 2015 · 2 comments
Closed

Verify error with self-referential lambda #43

dalewking opened this issue Jan 31, 2015 · 2 comments

Comments

@dalewking
Copy link

Hesitate to call this a bug but I'll report this here as it took many hours to track down.

We have an interface that contains a static field DEFAULT which is an instance of the interface itself as in:

public MyInterface
{
    int foo(int a);

    MyInterface DEFAULT = ...
}

Originally the value for default was an anoymous inner class as in:

MyInteface DEFAULT = new MyInterface()
{
    pubic int foo(int a) { return someCall(a); }
}

which worked find. After adding retrolambda to the project, Android Studio said we should convert that to a lambda expression like in:

MyInteface DEFAULT = a -> someCall(a);

The result is that this worked on Lollipop, but crashes with a verify error on pre-Lollipop.

Not sure if you can make this work, but if not you could at least fail the build if you detect it.

@mgrzechocinski
Copy link

Hey, in fact this was an issue and is already fixed in v1.8.1. Take a look at #42

@dalewking
Copy link
Author

Confirmed that 1.8.1 fixed the issue.

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

No branches or pull requests

2 participants