method refs: add constraint P1->ReferenceType for inexact method references despite of spec (IDEA-117311)

This commit is contained in:
Anna Kozlova
2014-01-29 20:58:06 +04:00
parent 9ef2c46b28
commit e2c708dfcf
4 changed files with 66 additions and 27 deletions

View File

@@ -0,0 +1,18 @@
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class Box<TBox>
{
public TBox getValue()
{
return null;
}
void foo(Stream<Box<String>> stream){
List<String> l1 = stream.map(Box<String>::getValue).collect(Collectors.toList());
List<String> l2 = stream.map(Box::getValue).collect(Collectors.toList());
}
}