Union type attributes for common super type calculation
This commit is contained in:
committed by
Dmitriy Novozhilov
parent
db471ca61e
commit
56d817b49f
+1
-1
@@ -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)
|
||||
return commonSuperType(types, -maxDepth, true).replaceTypeAttributes(unionTypeAttributes(types))
|
||||
}
|
||||
|
||||
private fun TypeSystemCommonSuperTypesContext.commonSuperType(
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ class PostponedArgumentInputTypesResolver(
|
||||
}
|
||||
}
|
||||
|
||||
val annotations = functionalTypesFromConstraints?.map { it.type.getAnnotations() }?.flatten()?.distinct()
|
||||
val annotations = functionalTypesFromConstraints?.map { it.type.getAttributes() }?.flatten()?.distinct()
|
||||
|
||||
val extensionFunctionTypePresentInConstraints = functionalTypesFromConstraints?.any { it.type.isExtensionFunctionType() } == true
|
||||
|
||||
|
||||
+5
-1
@@ -139,7 +139,11 @@ class MutableVariableWithConstraints private constructor(
|
||||
return false
|
||||
|
||||
return when (old.kind) {
|
||||
ConstraintKind.EQUALITY -> true
|
||||
ConstraintKind.EQUALITY -> {
|
||||
with(context) {
|
||||
old.type.getAttributes() == new.type.getAttributes()
|
||||
}
|
||||
}
|
||||
ConstraintKind.LOWER -> new.kind.isLower()
|
||||
ConstraintKind.UPPER -> new.kind.isUpper()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user