calc types by applicability constraints if inference fails

include all inference variables for resolve and ignore additional constraints checks if the inference is going to failure; this way if (expr()) would get type of the 'standalone' expression instead of expression with boolean as expected type
This commit is contained in:
Anna.Kozlova
2017-12-07 13:06:24 +01:00
parent c9a3fba58c
commit 1fc76eb779
17 changed files with 69 additions and 66 deletions

View File

@@ -14,7 +14,7 @@ class NoLambda {
static <T> T id(T i2) {return i2;}
{
id(<error descr="Object is not a functional interface">() -> {System.out.println("hi");}</error>);
id(<error descr="Target type of a lambda conversion must be an interface">() -> {System.out.println("hi");}</error>);
NoLambda.<Runnable>id(() -> {System.out.println("hi");});
}
}