mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix regression with incorrect type resolving for closure parameter
GitOrigin-RevId: 53b552039bfab2d51ebcd102eee6459d6730e27e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a50343a2d3
commit
93c84a43d9
+4
-4
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.plugins.groovy.intentions.style.inference
|
||||
|
||||
import com.intellij.openapi.util.RecursionManager
|
||||
import com.intellij.openapi.util.component1
|
||||
import com.intellij.openapi.util.component2
|
||||
import com.intellij.psi.*
|
||||
@@ -29,11 +30,10 @@ class CollectingGroovyInferenceSession(
|
||||
|
||||
companion object {
|
||||
fun getContextSubstitutor(resolveResult: GroovyMethodResult,
|
||||
nearestCall: GrCall): PsiSubstitutor {
|
||||
nearestCall: GrCall): PsiSubstitutor = RecursionManager.doPreventingRecursion(resolveResult, true) {
|
||||
val collectingSession = CollectingGroovyInferenceSession(nearestCall.parentOfType<GrMethod>()!!.typeParameters, nearestCall)
|
||||
return buildTopLevelSession(nearestCall, collectingSession).inferSubst(resolveResult)
|
||||
|
||||
}
|
||||
buildTopLevelSession(nearestCall, collectingSession).inferSubst(resolveResult)
|
||||
} ?: PsiSubstitutor.EMPTY
|
||||
}
|
||||
|
||||
private fun substituteForeignTypeParameters(type: PsiType?): PsiType? {
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ class InferredClosureParamsEnhancer : AbstractClosureParameterEnhancer() {
|
||||
val session = CollectingGroovyInferenceSession(virtualMethod.typeParameters, virtualMethod, resolveResult.contextSubstitutor,
|
||||
proxyMapping)
|
||||
session.addConstraint(MethodCallConstraint(null, resolveResult, virtualMethod))
|
||||
return session.inferSubst(resolveResult)
|
||||
return session.inferSubst()
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user