lambda: inference param types for assignment and cast context

This commit is contained in:
anna
2012-07-19 12:15:41 +02:00
parent 6b99ef5e9e
commit 5bb4a61bb9
9 changed files with 156 additions and 38 deletions

View File

@@ -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>
};
}