[FIR] Fix IOOBE in ConeTypeRenderer for bad extension function types

This commit is contained in:
Kirill Rakhman
2023-12-12 18:43:32 +01:00
committed by Space Team
parent 5ce2a2cbee
commit 2c74a2356a
@@ -37,7 +37,7 @@ open class ConeTypeRenderer(
} }
val typeArguments = type.typeArguments val typeArguments = type.typeArguments
val isExtension = type.isExtensionFunctionType val isExtension = type.isExtensionFunctionType
val (receiver, otherTypeArguments) = if (isExtension && typeArguments.first() != ConeStarProjection) { val (receiver, otherTypeArguments) = if (isExtension && typeArguments.size >= 2 && typeArguments.first() != ConeStarProjection) {
typeArguments.first() to typeArguments.drop(1) typeArguments.first() to typeArguments.drop(1)
} else { } else {
null to typeArguments.toList() null to typeArguments.toList()