From 310d98c4f7f60967fd392715e603b618abeb7140 Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Tue, 20 Apr 2021 15:00:59 +0300 Subject: [PATCH] Don't require existence of the corresponding type argument during computing target type to apply type use annotation loaded from class file ^KT-46131 Fixed --- .../kotlin/load/java/structure/impl/classFiles/Annotations.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/resolution.common.jvm/src/org/jetbrains/kotlin/load/java/structure/impl/classFiles/Annotations.kt b/compiler/resolution.common.jvm/src/org/jetbrains/kotlin/load/java/structure/impl/classFiles/Annotations.kt index 0e8e9aaedf9..61656c6c185 100644 --- a/compiler/resolution.common.jvm/src/org/jetbrains/kotlin/load/java/structure/impl/classFiles/Annotations.kt +++ b/compiler/resolution.common.jvm/src/org/jetbrains/kotlin/load/java/structure/impl/classFiles/Annotations.kt @@ -178,8 +178,7 @@ class BinaryJavaAnnotation private constructor( when (typePathKind) { TypePath.TYPE_ARGUMENT -> { require(targetType is JavaClassifierType) - targetType.typeArguments[typeArgumentIndex] - ?: throw IllegalArgumentException("There must be no less than ${typeArgumentIndex + 1} type arguments") + targetType.typeArguments.getOrNull(typeArgumentIndex) // temporary fix for KT-46131 } TypePath.WILDCARD_BOUND -> { require(targetType is JavaWildcardType)