From 234776820b0e9bdaa97edb1d6da7d81a612be779 Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Thu, 1 Nov 2018 14:47:55 +0300 Subject: [PATCH] Use KotlinLightReferenceListBuilder for type parameters bounds It doesn't run resolve() on freshly added reference, thus the latter is not failing in recursive case like T : Enum --- .../src/org/jetbrains/kotlin/asJava/classes/ultraLightUtils.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/light-classes/src/org/jetbrains/kotlin/asJava/classes/ultraLightUtils.kt b/compiler/light-classes/src/org/jetbrains/kotlin/asJava/classes/ultraLightUtils.kt index 28b8e51bc5c..5c08b3a6cf1 100644 --- a/compiler/light-classes/src/org/jetbrains/kotlin/asJava/classes/ultraLightUtils.kt +++ b/compiler/light-classes/src/org/jetbrains/kotlin/asJava/classes/ultraLightUtils.kt @@ -40,7 +40,8 @@ internal fun buildTypeParameterList( for ((i, ktParam) in declaration.typeParameters.withIndex()) { tpList.addParameter(object : LightTypeParameterBuilder(ktParam.name.orEmpty(), owner, i) { private val superList: LightReferenceListBuilder by lazyPub { - val boundList = LightReferenceListBuilder(manager, PsiReferenceList.Role.EXTENDS_BOUNDS_LIST) + val boundList = + KotlinLightReferenceListBuilder(manager, PsiReferenceList.Role.EXTENDS_BOUNDS_LIST) if (ktParam.extendsBound != null || declaration.typeConstraints.isNotEmpty()) { val boundTypes = (ktParam.resolve() as? TypeParameterDescriptor)?.upperBounds.orEmpty() .mapNotNull { it.asPsiType(ktParam, support, TypeMappingMode.DEFAULT, this) as? PsiClassType }