new inference: provide diagnostics on failed inference (strict subtyping constraints); don't resolve vars before incorporate - this way captures won't be opened too early

This commit is contained in:
Anna Kozlova
2015-11-23 16:55:24 +01:00
parent 24bfcbcd27
commit 138bd5a034
8 changed files with 24 additions and 21 deletions

View File

@@ -9,7 +9,8 @@ class Test {
<R> SuperFoo<R> foo(I<R> ax) { return null; }
SuperFoo<String> ls = foo(<error descr="inference variable R has incompatible bounds:
SuperFoo<String> ls = foo(<error descr="no instance(s) of type variable(s) exist so that String conforms to Number
inference variable R has incompatible bounds:
equality constraints: String
upper bounds: Object, Number">() -> new Foo<>()</error>);
SuperFoo<Integer> li = foo(() -> new Foo<>());

View File

@@ -26,7 +26,8 @@ abstract class NoFormalParamTypeInferenceNeeded {
{
map(a -> zip(text -> text));
zip(a -> zip(text -> text));
Integer zip = zip(a -> zip(<error descr="inference variable R has incompatible bounds:
Integer zip = zip(a -> zip(<error descr="no instance(s) of type variable(s) exist so that Object conforms to Integer
inference variable R has incompatible bounds:
lower bounds: Object
upper bounds: Object, R, Integer">text -> text</error>));
}