FIR types: relax requirements around flexible types
This commit is contained in:
committed by
Mikhail Glukhikh
parent
0ae2f992fa
commit
6f9f9fc087
@@ -109,6 +109,13 @@ abstract class ConeTypeParameterType : ConeLookupTagBasedType() {
|
||||
|
||||
class ConeFlexibleType(val lowerBound: ConeKotlinType, val upperBound: ConeKotlinType) : ConeKotlinType(),
|
||||
FlexibleTypeMarker {
|
||||
|
||||
init {
|
||||
val message = { "Bounds violation: $lowerBound, $upperBound" }
|
||||
require(lowerBound is SimpleTypeMarker, message)
|
||||
require(upperBound is SimpleTypeMarker, message)
|
||||
}
|
||||
|
||||
override val typeArguments: Array<out ConeKotlinTypeProjection>
|
||||
get() = emptyArray()
|
||||
|
||||
|
||||
+2
-2
@@ -41,8 +41,8 @@ interface ConeInferenceContext : TypeSystemInferenceExtensionContext,
|
||||
}
|
||||
|
||||
override fun createFlexibleType(lowerBound: SimpleTypeMarker, upperBound: SimpleTypeMarker): KotlinTypeMarker {
|
||||
require(lowerBound is ConeLookupTagBasedType)
|
||||
require(upperBound is ConeLookupTagBasedType)
|
||||
require(lowerBound is ConeKotlinType)
|
||||
require(upperBound is ConeKotlinType)
|
||||
|
||||
return ConeFlexibleType(lowerBound, upperBound)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user