mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 21:11:28 +07:00
method refs: test data to check enum/interface/annotation not accepted; isAcceptable checks on Array types
This commit is contained in:
@@ -25,6 +25,11 @@ class OnArrayTest {
|
||||
T make(int size);
|
||||
}
|
||||
|
||||
static class Foo<X> { }
|
||||
interface ObjectArrayReturnType {
|
||||
Object make(int size);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Cln s = int[]::clone;
|
||||
IA a = int[]::new;
|
||||
@@ -35,5 +40,8 @@ class OnArrayTest {
|
||||
ArrayReturnType<String[]> a1 = String[]::new;
|
||||
ArrayReturnType<String[][]> a2 = String[][]::new;
|
||||
<error descr="Incompatible types. Found: '<method reference>', required: 'OnArrayTest.ArrayReturnType<java.lang.String[]>'">ArrayReturnType<String[]> a3 = int[]::new;</error>
|
||||
|
||||
ObjectArrayReturnType a4 = Foo<?>[]::new;
|
||||
ObjectArrayReturnType a5 = Foo<? extends String>[]::new;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user