JDK-8179982 :
|
Initially seen here: http://stackoverflow.com/questions/42346895/constructor-reference-no-warning-when-generics-array-is-created Javac does not generate unchecked warnings when checking method reference return types. The issue is not limited to arrays. import java.util.function.*; import java.util.*; class Test { void m() { IntFunction<List<String>[]> sls = List[]::new; //no warning Supplier<List<String>> sls = this::l; //no warning } List l() { return null; } }
|