mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[groovy] don't compute methodCandidate when not needed in MethodResolveResult
This commit is contained in:
+6
-3
@@ -17,8 +17,11 @@ class MethodResolveResult(
|
||||
state: ResolveState
|
||||
) : BaseGroovyResolveResult<PsiMethod>(method, ref, state), GroovyMethodResult {
|
||||
|
||||
private val siteSubstitutor by lazy {
|
||||
super.getSubstitutor().putAll(method.typeParameters, ref.typeArguments)
|
||||
}
|
||||
|
||||
private val methodCandidate by lazy {
|
||||
val siteSubstitutor = state[PsiSubstitutor.KEY].putAll(method.typeParameters, ref.typeArguments)
|
||||
val qualifierConstraint = buildQualifier(ref, state)
|
||||
val argumentConstraints = buildArguments(ref)
|
||||
|
||||
@@ -36,7 +39,7 @@ class MethodResolveResult(
|
||||
|
||||
private val applicabilitySubstitutor by lazy {
|
||||
if (ref.typeArguments.isNotEmpty()) {
|
||||
methodCandidate.siteSubstitutor
|
||||
siteSubstitutor
|
||||
}
|
||||
else {
|
||||
GroovyInferenceSessionBuilder(ref, methodCandidate).build().inferSubst()
|
||||
@@ -45,7 +48,7 @@ class MethodResolveResult(
|
||||
|
||||
private val fullSubstitutor by lazy {
|
||||
if (ref.typeArguments.isNotEmpty()) {
|
||||
methodCandidate.siteSubstitutor
|
||||
siteSubstitutor
|
||||
}
|
||||
else {
|
||||
GroovyInferenceSessionBuilder(ref, methodCandidate)
|
||||
|
||||
Reference in New Issue
Block a user