method reference: registry option to skip unsound capture conversion specified in the spec but ignored by the javac, to be changed in the next spec version (IDEA-171488)

This commit is contained in:
Anna.Kozlova
2017-04-18 14:58:33 +02:00
parent a3dca1423c
commit c322dd3807
4 changed files with 29 additions and 5 deletions

View File

@@ -0,0 +1,15 @@
import java.util.Optional;
import java.util.function.Function;
abstract class View {
{
foo(View::returnType).orElse(void.class);
}
abstract <H> Optional<H> foo(Function<View, H> f);
public Class<?> returnType() {
return null;
}
}