new array refs: accept signatures with assignable to int params (IDEA-106973)

This commit is contained in:
anna
2013-05-13 14:19:41 +02:00
parent 6ebb8cbb47
commit 7a56eb198f
2 changed files with 34 additions and 2 deletions

View File

@@ -45,3 +45,16 @@ class OnArrayTest {
ObjectArrayReturnType a5 = Foo<? extends String>[]::new;
}
}
class IDEA106973 {
interface Function<T, R> {
R apply(T t);
}
{
Function<Integer, String[]> a = String[] :: new;
<error descr="Incompatible types. Found: '<method reference>', required: 'IDEA106973.Function<java.lang.String,java.lang.String[]>'">Function<String, String[]> a1 = String[] :: new;</error>
Function<Short, String[]> a2 = String[] :: new;
}
}