Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/inference/SimpleCyclicInference.java
Anna.Kozlova 1fc76eb779 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
2017-12-07 15:51:06 +01:00

20 lines
434 B
Java

class NoLambda {
interface I<T> {
void f(T t);
}
<Z> void bar(I<Z> iz) {
}
void bazz() {
bar(null);
bar((z)-> {System.out.println();});
}
static <T> T id(T i2) {return i2;}
{
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");});
}
}