inference: don't include constraints to resolve if input bounds have proper instantiation but depends on the output of another constraints (IDEA-153164)

This commit is contained in:
Anna.Kozlova
2016-03-17 21:21:41 +01:00
parent 4ad5c2006c
commit 53d3aa770c
6 changed files with 63 additions and 11 deletions

View File

@@ -0,0 +1,19 @@
// "Replace with lambda" "true"
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
class Test {
{
Map<Comparable, List<Collection<?>>> families = sortingMerge((Function<Collection<?>, Comparable>) family -> new Integer(0));
}
<C extends Comparable<C>, T> Map<C, List<T>> sortingMerge(
Function<T, C> keyFunction) {
return new HashMap<C, List<T>>();
}
}

View File

@@ -0,0 +1,24 @@
// "Replace with lambda" "true"
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
class Test {
{
Map<Comparable, List<Collection<?>>> families = sortingMerge(new Fun<caret>ction<Collection<?>, Comparable>() {
@Override
public Comparable<Integer> apply(Collection<?> family) {
return new Integer(0);
}
});
}
<C extends Comparable<C>, T> Map<C, List<T>> sortingMerge(
Function<T, C> keyFunction) {
return new HashMap<C, List<T>>();
}
}