mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
put new variable inside lambda body: check lambda-related types only after lambda body is fixed (EA-62133 - IOE: PsiJavaParserFacadeImpl.createStatementFromText)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
class Foo {
|
||||
interface I<T> {
|
||||
T m(Object op);
|
||||
}
|
||||
|
||||
interface J<T> {
|
||||
int m(T o);
|
||||
}
|
||||
|
||||
|
||||
void f(J r) {}
|
||||
void f(I<String> r) {}
|
||||
|
||||
{
|
||||
f((Object a) -> {
|
||||
int c = 1;
|
||||
return c;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
class Foo {
|
||||
interface I<T> {
|
||||
T m(Object op);
|
||||
}
|
||||
|
||||
interface J<T> {
|
||||
int m(T o);
|
||||
}
|
||||
|
||||
|
||||
void f(J r) {}
|
||||
void f(I<String> r) {}
|
||||
|
||||
{
|
||||
f((Object a) -> <selection>1</selection>);
|
||||
}
|
||||
}
|
||||
@@ -437,6 +437,10 @@ public class IntroduceVariableTest extends LightCodeInsightTestCase {
|
||||
doTest(new MockIntroduceVariableHandler("c", false, false, false, "int"));
|
||||
}
|
||||
|
||||
public void testPutInLambdaBody() {
|
||||
doTest(new MockIntroduceVariableHandler("c", false, false, false, "int"));
|
||||
}
|
||||
|
||||
public void testNormalizeDeclarations() {
|
||||
doTest(new MockIntroduceVariableHandler("i3", false, false, false, "int"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user