new inference: array constructor refs are always exact (IDEA-115725)

(cherry picked from commit 0f6538fc54bbee0aaf6cbab9884c0407937d4568)
This commit is contained in:
anna
2013-11-15 18:30:44 +01:00
parent 0c02d873d8
commit 23432e3cd7
3 changed files with 19 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
public class InspectorTest {
interface Stream<T> {
<A> A[] toArray(IntFunction<A[]> generator);
}
interface IntFunction<R> {
R apply(int value);
}
public static void main(Stream<Object> objectStream){
varargMethod(String[]::new,
objectStream.toArray(String[]::new));
}
public static <T> void varargMethod(IntFunction<T[]> generator,T[]... a){}
}