mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
anonymous -> lambda: allow qualified this/super expr (IDEA-93697)
This commit is contained in:
+14
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
+19
@@ -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();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user