mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 05:10:22 +07:00
EA-88093 - IOE: PsiElementFactoryImpl.createField
This commit is contained in:
@@ -405,6 +405,9 @@ public class GenerateDelegateHandler implements LanguageCodeInsightActionHandler
|
||||
final PsiVariable psiVariable = proc.getResult(i);
|
||||
final PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(aClass.getProject());
|
||||
final PsiType type = psiVariable.getType();
|
||||
if (LambdaUtil.notInferredType(type)) {
|
||||
continue;
|
||||
}
|
||||
result.add(new PsiFieldMember(elementFactory.createField(psiVariable.getName(), type instanceof PsiEllipsisType ? ((PsiEllipsisType)type).toArrayType() : type)) {
|
||||
@Override
|
||||
protected PsiClass getContainingClass() {
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
class Test {
|
||||
|
||||
public void foo() {
|
||||
|
||||
foo(s -> {
|
||||
new Function<String, String>() {
|
||||
{
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
class Test {
|
||||
|
||||
public void foo() {
|
||||
|
||||
foo(s -> {
|
||||
new Function<String, String>() {
|
||||
{
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
@@ -92,6 +92,10 @@ public class DelegateMethodsTest extends LightCodeInsightTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInsideLambdaWithNonInferredTypeParameters() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() throws Exception {
|
||||
doTest(getTestName(false));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user