Skip to content
This repository has been archived by the owner on Jun 29, 2021. It is now read-only.

Does not compile lambda expression #638

Open
natebass opened this issue Nov 19, 2016 · 4 comments
Open

Does not compile lambda expression #638

natebass opened this issue Nov 19, 2016 · 4 comments

Comments

@natebass
Copy link

When I try to compile the app from source I get this error.

/Users/NateBass/A/Android/Gitskarios/app/src/main/java/com/alorma/github/presenter/CommitInfoPresenter.java
Error:(23, 57) error: incompatible types: bad return type in lambda expression
Observable<Pair<GithubStatusResponse,Integer>> cannot be converted to Observable<? extends CAP#1>
where CAP#1 is a fresh type-variable:
CAP#1 extends Pair<GithubStatusResponse,Integer> from capture of ? extends Pair<GithubStatusResponse,Integer>
@alorma
Copy link
Contributor

alorma commented Nov 19, 2016

hi. I will check it.

Could you try to expand the lambda expression, what happens then?

@natebass
Copy link
Author

In the editor I pressed alt-enter and "Expand lambda expression body to {...}". Is that what you mean? The code now looks like this, and it gives the same error.

Observable<GithubStatusResponse> shaCombinedStatus = new GetShaCombinedStatus(commitInfo.repoInfo, commitInfo.sha).observable()
        .onErrorResumeNext(throwable -> {
          return Observable.empty();
        })
        .map(o -> {
          return o.first;
        });

@alorma
Copy link
Contributor

alorma commented Nov 20, 2016

Weird, could you keep expanding lambda? You should get anonymous classes, and a ? somewhere, change it to return type of observable. It should work

@natebass
Copy link
Author

I tried, and failed. No worries, I deleted that line for now so I can work on something 🤘

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

No branches or pull requests

2 participants