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:
Anna Kozlova
2014-10-24 18:36:22 +02:00
parent 04d5460d03
commit a56e52d868
4 changed files with 53 additions and 12 deletions
@@ -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"));
}