mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-28 17:29:55 +07:00
method refs: decline constructor refs on array ref with inapplicable substitutor
This commit is contained in:
@@ -21,7 +21,9 @@ class OnArrayTest {
|
||||
String _(T[] ta);
|
||||
}
|
||||
|
||||
|
||||
interface ArrayReturnType<T> {
|
||||
T make(int size);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Cln s = int[]::clone;
|
||||
@@ -29,5 +31,9 @@ class OnArrayTest {
|
||||
<error descr="Incompatible types. Found: '<method reference>', required: 'OnArrayTest.I'">I i = int[]::new;</error>
|
||||
<error descr="Incompatible types. Found: '<method reference>', required: 'OnArrayTest.Len<java.lang.String>'">Len<String> strLen = String[]::length;</error>
|
||||
ToStr<Integer> toStr = Integer[]::toString;
|
||||
|
||||
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>
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user