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:
Victor Petukhov
2021-06-16 18:55:03 +03:00
committed by TeamCityServer
parent 6a78e0a10c
commit 4aeabb6b0f
21 changed files with 424 additions and 18 deletions
@@ -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