anonymous -> lambda: allow qualified this/super expr (IDEA-93697)

This commit is contained in:
anna
2012-10-26 13:56:08 +02:00
parent 55aeb52585
commit 64b2932d5e
3 changed files with 39 additions and 2 deletions
@@ -0,0 +1,14 @@
// "Replace with lambda" "true"
class Test {
interface Eff<A, B> {
B f(A a);
}
interface InOut<A> {
A run() throws IOException;
<B> InOut<B> bind(final Eff<A, InOut<B>> f) default {
return () -> f.f(InOut.this.run()).run();
}
}
}
@@ -0,0 +1,19 @@
// "Replace with lambda" "true"
class Test {
interface Eff<A, B> {
B f(A a);
}
interface InOut<A> {
A run() throws IOException;
<B> InOut<B> bind(final Eff<A, InOut<B>> f) default {
return new In<caret>Out<B>() {
@Override
public B run() throws IOException {
return f.f(InOut.this.run()).run();
}
};
}
}
}