From becc9c21f0205fae7bb235b483842db5d9ddb3c5 Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Mon, 10 Feb 2020 10:54:57 +0300 Subject: [PATCH] FIR: Map raw types properly --- .../src/org/jetbrains/kotlin/fir/java/JavaUtils.kt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaUtils.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaUtils.kt index 680be215c77..6bf533bb124 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaUtils.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaUtils.kt @@ -170,12 +170,18 @@ internal fun JavaClassifierType.toConeKotlinTypeWithNullability( classId = classId.readOnlyToMutable() ?: classId val lookupTag = ConeClassLikeLookupTagImpl(classId) - lookupTag.constructClassType( - typeArguments.map { argument -> + + val mappedTypeArguments = when (isRaw) { + true -> classifier.typeParameters.map { ConeStarProjection } + false -> typeArguments.map { argument -> argument.toConeProjection( session, javaTypeParameterStack, boundTypeParameter = null, nullability = typeParametersNullability ) - }.toTypedArray(), nullability.isNullable + } + } + + lookupTag.constructClassType( + mappedTypeArguments.toTypedArray(), nullability.isNullable ) } is JavaTypeParameter -> {