Do not enhance type parameter bounds if they contain a raw type

Otherwise enhancement algorithm starts forcing lazy mutually recursive
computations that leads to RECURSION_IN_SUPERTYPES in complex cases
This commit is contained in:
Denis Zharkov
2019-08-21 17:17:41 +03:00
committed by Victor Petukhov
parent c1b34a83e9
commit 16b4a2c465
@@ -39,6 +39,7 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.firstArgument
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameOrNull
import org.jetbrains.kotlin.types.*
import org.jetbrains.kotlin.types.checker.KotlinTypeChecker
import org.jetbrains.kotlin.types.typeUtil.contains
import org.jetbrains.kotlin.types.typeUtil.isTypeParameter
import org.jetbrains.kotlin.utils.JavaTypeEnhancementState
import org.jetbrains.kotlin.utils.ReportLevel
@@ -241,6 +242,8 @@ class SignatureEnhancement(
context: LazyJavaResolverContext
): List<KotlinType> {
return bounds.map { bound ->
if (bound.contains { it is RawType }) return@map bound
SignatureParts(
typeParameter, bound, emptyList(), false, context,
AnnotationQualifierApplicabilityType.TYPE_PARAMETER_BOUNDS,