Process raw types during erasion properly

^KT-46670 Fixed
^KT-46476 Fixed
This commit is contained in:
Victor Petukhov
2021-05-14 18:57:59 +03:00
parent 570d860217
commit 0d6764efc5
14 changed files with 174 additions and 7 deletions
@@ -232,7 +232,7 @@ private fun KotlinType.containsSelfTypeParameter(
val typeParameters = (constructor.declarationDescriptor as? ClassifierDescriptorWithTypeParameters)?.declaredTypeParameters
return arguments.withIndex().any { (i, argument) ->
val typeParameter = typeParameters?.get(i)
val typeParameter = typeParameters?.getOrNull(i)
if ((typeParameter != null && typeParameter == upperBoundOfTypeParameter) || argument.isStarProjection) return@any false
argument.type.containsSelfTypeParameter(baseConstructor, upperBoundOfTypeParameter)
}