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

@@ -12,7 +12,8 @@ class TypeArgsConsistency {
I<Integer> i1 = (i, j) -> i + j;
foo((i, j) -> i + j);
I<Integer> i2 = bar((i, j) -> i + j);
I<Integer> i3 = bar(<error descr="inference variable X has incompatible bounds:
I<Integer> i3 = bar(<error descr="no instance(s) of type variable(s) exist so that String conforms to Integer
inference variable X has incompatible bounds:
equality constraints: Integer
lower bounds: String">(i, j) -> "" + i + j</error>);
}
@@ -45,7 +46,8 @@ class TypeArgsConsistency2 {
I<Integer> i1 = bar(x -> x);
I1<Integer> i2 = bar1(x -> 1);
I2<String> aI2 = bar2(x -> "");
I2<Integer> aI28 = bar2( <error descr="inference variable T has incompatible bounds:
I2<Integer> aI28 = bar2( <error descr="no instance(s) of type variable(s) exist so that String conforms to Integer
inference variable T has incompatible bounds:
equality constraints: Integer
lower bounds: String">x-> ""</error>);
I2<Integer> i3 = bar2(x -> x);