inference errors: make applicability error thread safe so multiple threads can perform overload resolution of parent method calls independently, save presentable error when substitutor cached only

This commit is contained in:
Anna Kozlova
2017-05-08 12:12:13 +03:00
parent fa07225451
commit 77f4894aae
36 changed files with 145 additions and 136 deletions
@@ -22,10 +22,14 @@ abstract class FooBar<M> {
}
class Test {
<T> List<List<Object>> foo(List<T> objects, Function<T, ?>... functions) {
return objects.stream()
return <error descr="Incompatible types. Required List<List<Object>> but 'collect' was inferred to R:
no instance(s) of type variable(s) exist so that List<capture of ?> conforms to List<Object>
inference variable T has incompatible bounds:
equality constraints: List<Object>
lower bounds: List<capture of ?>">objects.stream()
.map(object -> Arrays.stream(functions)
.map(fn -> fn.apply(object))
.collect(toList()))
.collect(toList<error descr="'toList()' in 'java.util.stream.Collectors' cannot be applied to '()'">()</error>);
.collect(toList());</error>
}
}