mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[groovy] resolve: check property result validity (IDEA-187712)
This commit is contained in:
+1
-1
@@ -280,7 +280,7 @@ public abstract class GroovyResolverProcessor implements PsiScopeProcessor, Elem
|
||||
if (kind == GroovyResolveKind.PROPERTY) {
|
||||
myAccessorProcessors.forEach(
|
||||
it -> it.getResults().stream().filter(
|
||||
result -> applicable == result.isApplicable()
|
||||
result -> applicable == result.isValidResult()
|
||||
).forEach(results::add)
|
||||
);
|
||||
}
|
||||
|
||||
+11
@@ -1505,4 +1505,15 @@ class Foo {
|
||||
disableTransformations testRootDisposable
|
||||
resolveByText 'def abc = 42; [:].with { <caret>abc }', GrVariable
|
||||
}
|
||||
|
||||
void 'test Class property vs instance property'() {
|
||||
def property = resolveByText '''\
|
||||
class A {
|
||||
int getName() { 42 }
|
||||
}
|
||||
|
||||
println A.<caret>name
|
||||
''', PsiMethod
|
||||
assert property.containingClass.qualifiedName == 'java.lang.Class'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user