mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
lambda: inline lambda initialized vars
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
interface SAM<X> {
|
||||
X m(int i, int j);
|
||||
}
|
||||
|
||||
class Foo {
|
||||
void test() {
|
||||
SAM<Integer> c = (i, j)->i + j;
|
||||
m(<caret>c);
|
||||
}
|
||||
void m(SAM<Integer> s) { }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
interface SAM<X> {
|
||||
X m(int i, int j);
|
||||
}
|
||||
|
||||
class Foo {
|
||||
void test() {
|
||||
m((i, j)->i + j);
|
||||
}
|
||||
void m(SAM<Integer> s) { }
|
||||
}
|
||||
@@ -136,6 +136,10 @@ public class InlineLocalTest extends LightCodeInsightTestCase {
|
||||
doTest(false, "Cannot perform refactoring.\n" +
|
||||
"Variable 'x' is accessed for writing.");
|
||||
}
|
||||
|
||||
public void testLambdaExpr() throws Exception {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
private void doTest(final boolean inlineDef, String conflictMessage) throws Exception {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user