Last active
August 29, 2015 14:26
-
-
Save raphw/972137a8f5cdcb294c29 to your computer and use it in GitHub Desktop.
Example for VerifierError when using method reference within a lambda before constructor is completed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Example { | |
Example(Function<Function<Function<Consumer<Void>, Void>, Void>, Void> innerClass) { | |
new InnerClass(innerClass); | |
} | |
void foo(Void v) { } | |
class InnerClass { | |
InnerClass(Function<Function<Function<Consumer<Void>, Void>, Void>, Void> factory) { | |
this(factory.apply(o -> o.apply(Example.this::foo))); | |
} | |
InnerClass(Void unused) { } | |
} | |
public static void main(String[] args) { | |
new Example(o -> null); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment