mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[^yole] EA-27703 - a chained call with null-safe invocation can't seem to be a qualified class name
This commit is contained in:
@@ -1133,6 +1133,8 @@ public class PsiUtil {
|
||||
final PsiElement nameElement = ((GrReferenceExpression)qualifier).getReferenceNameElement();
|
||||
if (((GrReferenceExpression)qualifier).getTypeArguments().length > 0) return false;
|
||||
if (nameElement == null || nameElement.getNode().getElementType() != GroovyTokenTypes.mIDENT) return false;
|
||||
IElementType dotType = ((GrReferenceExpression)qualifier).getDotTokenType();
|
||||
if (dotType != null && dotType != GroovyTokenTypes.mDOT) return false;
|
||||
qualifier = ((GrReferenceExpression)qualifier).getQualifierExpression();
|
||||
}
|
||||
return qualifier == null;
|
||||
|
||||
@@ -206,6 +206,10 @@ public class TypeInferenceTest extends GroovyResolveTestCase {
|
||||
assertTypeEquals("java.lang.String", "A.groovy");
|
||||
}
|
||||
|
||||
public void testSafeInvocationInClassQualifier() {
|
||||
assertTypeEquals("java.lang.Class", "SafeInvocationInClassQualifier.groovy");
|
||||
}
|
||||
|
||||
public void testReturnTypeFromMethodClosure() {
|
||||
assertTypeEquals("java.lang.String","A.groovy");
|
||||
}
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
def foo = []
|
||||
println foo?.prop?.cl<ref>ass
|
||||
Reference in New Issue
Block a user