mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-106091 Groovy: index access resolving in case of unresolved invoked expression
This commit is contained in:
+7
-2
@@ -72,7 +72,10 @@ public class GrIndexPropertyImpl extends GrExpressionImpl implements GrIndexProp
|
||||
GrExpression selected = getInvokedExpression();
|
||||
PsiType thisType = selected.getType();
|
||||
|
||||
if (thisType == null) return null;
|
||||
if (thisType == null) {
|
||||
thisType = TypesUtil.getJavaLangObject(this);
|
||||
}
|
||||
|
||||
|
||||
GrArgumentList argList = getArgumentList();
|
||||
|
||||
@@ -153,7 +156,9 @@ public class GrIndexPropertyImpl extends GrExpressionImpl implements GrIndexProp
|
||||
GrExpression invoked = getInvokedExpression();
|
||||
PsiType thisType = invoked.getType();
|
||||
|
||||
if (thisType == null) return GroovyResolveResult.EMPTY_ARRAY;
|
||||
if (thisType == null) {
|
||||
thisType = TypesUtil.getJavaLangObject(this);
|
||||
}
|
||||
|
||||
GrArgumentList argList = getArgumentList();
|
||||
|
||||
|
||||
+2
-2
@@ -570,7 +570,7 @@ print i<warning descr="'getAt' in 'X' cannot be applied to '(java.lang.String, j
|
||||
|
||||
void testArrayAccess5() {
|
||||
testHighlighting('''\
|
||||
print a<warning descr="Cannot resolve index access with arguments (java.lang.Integer)">[1]</warning>
|
||||
print a<warning descr="'getAt' in 'org.codehaus.groovy.runtime.DefaultGroovyMethods' cannot be applied to '(java.lang.Integer, java.lang.Integer)'">[1, 2]</warning>
|
||||
''')
|
||||
}
|
||||
|
||||
@@ -632,7 +632,7 @@ i<warning descr="'putAt' in 'X' cannot be applied to '(java.lang.String, java.la
|
||||
|
||||
void testArrayAccess10() {
|
||||
testHighlighting('''\
|
||||
a<warning descr="Cannot resolve index access with arguments (java.lang.Integer, java.lang.Integer)">[1]</warning> = 2
|
||||
a<warning descr="'putAt' in 'org.codehaus.groovy.runtime.DefaultGroovyMethods' cannot be applied to '(java.lang.Integer, java.lang.Integer, java.lang.Integer)'">[1, 3]</warning> = 2
|
||||
''')
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
java.lang.Object foo;
|
||||
print(foo.getAt(1));
|
||||
print(org.codehaus.groovy.runtime.DefaultGroovyMethods.getAt(foo, 1));
|
||||
|
||||
Reference in New Issue
Block a user