mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
new inference: 18.5.2 adjustments
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@ class NoInferenceResult {
|
||||
m((String s1) -> s1.length());
|
||||
m((String s1) -> s1);
|
||||
|
||||
m1(<error descr="Target type of a lambda conversion must be an interface">() -> { }</error>);
|
||||
m1<error descr="'m1(T)' in 'NoInferenceResult' cannot be applied to '(<lambda expression>)'">(() -> { })</error>;
|
||||
|
||||
Foo<String> foo = new Foo<String>();
|
||||
foo.map(v -> null);
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ class ReturnTypeIncompatibility {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
call<error descr="Ambiguous method call: both 'ReturnTypeIncompatibility.call(I1<Integer>)' and 'ReturnTypeIncompatibility.call(I2<Integer>)' match">(i-> {return i;})</error>;
|
||||
call<error descr="Ambiguous method call: both 'ReturnTypeIncompatibility.call(I1<Integer>)' and 'ReturnTypeIncompatibility.call(I2<P>)' match">(i-> {return i;})</error>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ class Test1 {
|
||||
if (s.equals("1")) {
|
||||
return Option.option(1);
|
||||
} else {
|
||||
return Option.option<error descr="'option(java.lang.Integer)' in 'Test1.Option' cannot be applied to '(java.lang.String)'">("2")</error>;
|
||||
return Option.option<error descr="'option(T)' in 'Test1.Option' cannot be applied to '(java.lang.String)'">("2")</error>;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
+2
-2
@@ -12,7 +12,7 @@ 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="Incompatible return type String in lambda expression">(i, j) -> "" + i + j</error>);
|
||||
I<Integer> i3 = bar(<error descr="Cyclic inference">(i, j) -> "" + i + j</error>);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ 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="Incompatible return type String in lambda expression">x-> ""</error>);
|
||||
I2<Integer> aI28 = bar2( <error descr="Cyclic inference">x-> ""</error>);
|
||||
I2<Integer> i3 = bar2(x -> x);
|
||||
I2<Integer> i4 = bar2(x -> foooI());
|
||||
System.out.println(i4.foo(2));
|
||||
|
||||
Reference in New Issue
Block a user