Skip to content

Method references to private methods #17

Closed
@naixx

Description

@naixx

Hi. The problem is:

{
  someObserable.finallyDo(this::myProblemMethod);
}

private void myProblemMethod(){}

The code is compiled and dexed to run on Davlik VM. But in runtime on an android device I get warnings and the method isn't called, of course.

 DexOpt: illegal method access (ca;.myProblemMethod ()V from (Fragment$$Lambda$1;)
 I/dalvikvm﹕ Could not find method myProblemMethod, referenced from method Fragment$$Lambda$1.call
VFY: unable to resolve virtual method 43525:

The code works as a lambda if myProblemMethod is package private, public, everything except private. The method can be called explicitly. But it doesn't work as a method reference. Warnings appear only once.

So, is it a problem, that retrolambda somehow processes references, so that dex excludes them from the build?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions