mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
method refs: accept instance inner classes from instance methods
This commit is contained in:
+1
-1
@@ -378,7 +378,7 @@ public class PsiMethodReferenceExpressionImpl extends PsiReferenceExpressionBase
|
||||
final boolean staticOrValidConstructorRef = psiMethod.hasModifierProperty(PsiModifier.STATIC) || validConstructorRef;
|
||||
|
||||
if ((parameterTypes.length == signatureParameterTypes2.length || varArgs && parameterTypes.length >= signatureParameterTypes2.length) &&
|
||||
(!myBeginsWithReferenceType || staticOrValidConstructorRef)) {
|
||||
(!myBeginsWithReferenceType || staticOrValidConstructorRef || (psiMethod.isConstructor() && conflict.isStaticsScopeCorrect()))) {
|
||||
boolean correct = true;
|
||||
for (int i = 0; i < parameterTypes.length; i++) {
|
||||
final PsiType type1 = parameterTypes[i];
|
||||
|
||||
+34
-1
@@ -115,4 +115,37 @@ class NonStaticInner2 {
|
||||
{
|
||||
I1 i1 = NonStaticInner2.Inner :: new;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class NonStaticInner3 {
|
||||
class Foo {
|
||||
Foo(Integer i) {}
|
||||
Foo() {}
|
||||
}
|
||||
|
||||
interface I1<X> {
|
||||
X m(int i);
|
||||
}
|
||||
|
||||
interface I2<X> {
|
||||
X m();
|
||||
}
|
||||
|
||||
interface I3<X> {
|
||||
X m(NonStaticInner3 rec, int i);
|
||||
}
|
||||
|
||||
interface I4<X> {
|
||||
X m(NonStaticInner3 rec);
|
||||
}
|
||||
|
||||
{
|
||||
I1<Foo> b1 = Foo::new;
|
||||
I2<Foo> b2 = Foo::new;
|
||||
}
|
||||
|
||||
{
|
||||
I3<Foo> b1 = Foo::new;
|
||||
I4<Foo> b2 = Foo::new;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user