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
This commit is contained in:
Victor Petukhov
2021-04-20 15:00:59 +03:00
parent 13b1664edf
commit 310d98c4f7
@@ -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)