[FIR] Fix giant type produced by CST

#KT-65704 Fixed
This commit is contained in:
Kirill Rakhman
2024-03-15 13:07:18 +01:00
committed by Space Team
parent 81c0ee471f
commit 85a1d67d19
2 changed files with 3 additions and 3 deletions
@@ -400,8 +400,8 @@ object NewCommonSuperTypeCalculator {
if (parameter.getVariance() == TypeVariance.IN)
return false // arguments for contravariant parameters are intersected, recursion should not be possible
val originalTypesSet = originalTypesForCst.toSet()
val typeArgumentsTypeSet = typeArgumentsForSuperConstructorParameter.map { it.getType().lowerBoundIfFlexible().originalIfDefinitelyNotNullable() }.toSet()
val originalTypesSet = originalTypesForCst.mapTo(mutableSetOf()) { it.lowerBoundIfFlexible().originalIfDefinitelyNotNullable() }
val typeArgumentsTypeSet = typeArgumentsForSuperConstructorParameter.mapTo(mutableSetOf()) { it.getType().lowerBoundIfFlexible().originalIfDefinitelyNotNullable() }
if (originalTypesSet.size != typeArgumentsTypeSet.size)
return false