[AA] Fix rendering for type variable with "Type is not inferred"

It is required to show type variable name instead of ERROR in completion
^KTIJ-20913
This commit is contained in:
aleksandrina-streltsova
2023-03-14 11:08:27 +02:00
committed by Space Team
parent bccf1aaff0
commit 34c739789f
4 changed files with 11 additions and 1 deletions
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.fir.resolve.substitution
import org.jetbrains.kotlin.fir.FirSession
import org.jetbrains.kotlin.fir.diagnostics.ConeSimpleDiagnostic
import org.jetbrains.kotlin.fir.diagnostics.ConeTypeVariableTypeIsNotInferred
import org.jetbrains.kotlin.fir.diagnostics.DiagnosticKind
import org.jetbrains.kotlin.fir.resolve.fullyExpandedType
import org.jetbrains.kotlin.fir.resolve.toFirRegularClassSymbol
@@ -320,7 +321,7 @@ class ConeStubAndTypeVariableToErrorTypeSubstitutor(
override fun substituteType(type: ConeKotlinType): ConeKotlinType? {
return when (type) {
is ConeTypeVariableType -> ConeErrorType(
ConeSimpleDiagnostic("Type for ${type.lookupTag.debugName} is not inferred", DiagnosticKind.InferenceError),
ConeTypeVariableTypeIsNotInferred(type),
isUninferredParameter = true
)
is ConeStubType -> runIf(type.constructor in stubTypesToReplace) {