inference: check substituted intersection type during resolution

This commit is contained in:
Anna.Kozlova
2017-12-06 14:54:24 +01:00
parent 9a929629f5
commit 6180b5b337
3 changed files with 22 additions and 1 deletions
@@ -0,0 +1,17 @@
import java.util.Collection;
import java.util.TreeSet;
import java.util.stream.Collectors;
import java.util.stream.Stream;
class MyTest {
public <T> void from(Page<T> elements) { }
public <T> void from(Collection<T> elements) { }
public void foo(final Stream<String> artifactStream) {
from(artifactStream.collect(Collectors.toCollection(<error descr="Bad return type in method reference: cannot convert java.util.TreeSet<java.lang.String> to C">TreeSet<String>::new</error>)));
}
interface Page<T> extends Iterable<T> {}
}