Use upper bound aware type approximator for intersection types inside sam types in contravariant positions to build proper types in terms of subtyping
This commit is contained in:
committed by
TeamCityServer
parent
6a78e0a10c
commit
4aeabb6b0f
@@ -325,6 +325,7 @@ interface TypeSystemContext : TypeSystemOptimizationContext {
|
||||
fun TypeParameterMarker.getVariance(): TypeVariance
|
||||
fun TypeParameterMarker.upperBoundCount(): Int
|
||||
fun TypeParameterMarker.getUpperBound(index: Int): KotlinTypeMarker
|
||||
fun TypeParameterMarker.getUpperBounds(): List<KotlinTypeMarker>
|
||||
fun TypeParameterMarker.getTypeConstructor(): TypeConstructorMarker
|
||||
fun TypeParameterMarker.hasRecursiveBounds(selfConstructor: TypeConstructorMarker): Boolean
|
||||
|
||||
|
||||
@@ -230,6 +230,11 @@ interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext, TypeSy
|
||||
return this.upperBounds[index]
|
||||
}
|
||||
|
||||
override fun TypeParameterMarker.getUpperBounds(): List<KotlinTypeMarker> {
|
||||
require(this is TypeParameterDescriptor, this::errorMessage)
|
||||
return this.upperBounds
|
||||
}
|
||||
|
||||
override fun TypeParameterMarker.getTypeConstructor(): TypeConstructorMarker {
|
||||
require(this is TypeParameterDescriptor, this::errorMessage)
|
||||
return this.typeConstructor
|
||||
|
||||
Reference in New Issue
Block a user