Fix union related failures.

This commit is contained in:
Irene Dea
2021-12-20 02:03:54 -08:00
committed by Dmitriy Novozhilov
parent a98e2c4e03
commit 13bff10567
7 changed files with 25 additions and 16 deletions
@@ -15,7 +15,7 @@ import org.jetbrains.kotlin.types.model.*
object NewCommonSuperTypeCalculator {
fun TypeSystemCommonSuperTypesContext.commonSuperType(types: List<KotlinTypeMarker>): KotlinTypeMarker {
val maxDepth = types.maxOfOrNull { it.typeDepth() } ?: 0
return commonSuperType(types, -maxDepth, true).let { it.replaceTypeAttributes(unionTypeAttributes(listOf(it) + types)) }
return commonSuperType(types, -maxDepth, true).replaceCustomAttributes(unionTypeAttributes(types))
}
private fun TypeSystemCommonSuperTypesContext.commonSuperType(