8296171: Compiler incorrectly rejects code with variadic method references

Reviewed-by: mcimadamore
This commit is contained in:
Vicente Romero 2022-11-14 18:31:26 +00:00
parent 749335d34a
commit 3eb789af74
2 changed files with 36 additions and 15 deletions

View file

@ -132,5 +132,25 @@ public class BoundUnboundSearchTest extends CompilationTestCase {
}
"""
);
assertOK(
getDiagConsumer(0, -1),
"""
import java.util.function.*;
interface Intf {
Object apply(String... args);
}
public class Test {
public static Object foo(Object o) { return "bar"; }
public final Object foo(Object... o) { return "foo"; }
public void test() {
Intf f = this::foo;
}
}
"""
);
}
}