[Jspecify] Use arguments of enhancement of type instead of arguments of base type during getting enhancement of type deeply

This commit is contained in:
Victor Petukhov
2021-05-12 19:28:21 +03:00
parent 21dada4d2d
commit 0c4cba549d
7 changed files with 61 additions and 60 deletions
@@ -118,6 +118,7 @@ private fun KotlinType.wereTypeArgumentsChanged(newArguments: List<TypeProjectio
}
private fun KotlinType.getEnhancementDeeplyInternal(): KotlinType {
val arguments = if (this is TypeWithEnhancement) enhancement.arguments else arguments
val newArguments = arguments.enhanceTypeArguments()
val newArgumentsForUpperBound = if (this is FlexibleType) upperBound.arguments.enhanceTypeArguments() else newArguments
val enhancedType = if (this is TypeWithEnhancement) enhancement else this