mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 02:24:40 +02:00
8296171: Compiler incorrectly rejects code with variadic method references
Reviewed-by: mcimadamore
This commit is contained in:
parent
749335d34a
commit
3eb789af74
2 changed files with 36 additions and 15 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
"""
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue