mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[groovy] Don't process return types in extended inference when it was invoked in lite mode
GitOrigin-RevId: a3cf9f2580be272db2f249dddf4eb3b2d418b705
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f6fecbf935
commit
71c9bf7d9b
+4
@@ -28,6 +28,8 @@ open class SignatureInferenceContext(val ignored: List<GrMethod>) {
|
||||
open fun ignoreMethod(method: GrMethod): SignatureInferenceContext {
|
||||
return SignatureInferenceContext(listOf(method, *ignored.toTypedArray()))
|
||||
}
|
||||
|
||||
open val allowedToProcessReturnType : Boolean = true
|
||||
}
|
||||
|
||||
object DefaultInferenceContext : SignatureInferenceContext(emptyList())
|
||||
@@ -53,4 +55,6 @@ class ClosureIgnoringInferenceContext(private val manager: PsiManager, ignored:
|
||||
override fun ignoreMethod(method: GrMethod): SignatureInferenceContext {
|
||||
return ClosureIgnoringInferenceContext(manager, listOf(method, *ignored.toTypedArray()))
|
||||
}
|
||||
|
||||
override val allowedToProcessReturnType: Boolean = false
|
||||
}
|
||||
+6
-4
@@ -368,10 +368,12 @@ internal class RecursiveMethodAnalyzer(val method: GrMethod, signatureInferenceC
|
||||
}
|
||||
|
||||
private fun processExitExpression(expression: GrExpression) {
|
||||
val returnType = expression.parentOfType<GrMethod>()?.returnType?.takeIf { it != PsiType.NULL && it != PsiType.VOID } ?: return
|
||||
builder.addConstrainingExpression(expression)
|
||||
val typeParameter = expression.type.typeParameter() ?: return
|
||||
builder.generateRequiredTypes(typeParameter, returnType, UPPER)
|
||||
if (builder.signatureInferenceContext.allowedToProcessReturnType) {
|
||||
val returnType = expression.parentOfType<GrMethod>()?.returnType?.takeIf { it != PsiType.NULL && it != PsiType.VOID } ?: return
|
||||
builder.addConstrainingExpression(expression)
|
||||
val typeParameter = expression.type.typeParameter() ?: return
|
||||
builder.generateRequiredTypes(typeParameter, returnType, UPPER)
|
||||
}
|
||||
}
|
||||
|
||||
fun buildUsageInformation(): TypeUsageInformation = builder.build()
|
||||
|
||||
Reference in New Issue
Block a user