mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 17:20:55 +07:00
lambda: inference param types for assignment and cast context
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import java.lang.String;
|
||||
|
||||
interface I {
|
||||
void m(int i);
|
||||
}
|
||||
|
||||
interface A<B> {
|
||||
void foo(B b);
|
||||
}
|
||||
|
||||
class Foo {
|
||||
I ii = (final <error descr="Cannot resolve symbol 'k'">k</error><error descr="Identifier expected">)</error>->{};
|
||||
I ii1 = (k)->{
|
||||
int i = k;
|
||||
<error descr="Incompatible types. Found: 'int', required: 'java.lang.String'">String s = k;</error>
|
||||
};
|
||||
|
||||
A<String> a = (ab) -> {
|
||||
String s = ab;
|
||||
<error descr="Incompatible types. Found: 'java.lang.String', required: 'int'">int i = ab;</error>
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user