[FIR] Introduce ConeDynamicType
This commit is contained in:
@@ -80,9 +80,9 @@ open class ConeFlexibleType(
|
||||
|
||||
final override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
if (javaClass != other?.javaClass) return false
|
||||
|
||||
other as ConeFlexibleType
|
||||
// I suppose dynamic type (see below) and flexible type should use the same equals,
|
||||
// because ft<Any?, Nothing> should never be created
|
||||
if (other !is ConeFlexibleType) return false
|
||||
|
||||
if (lowerBound != other.lowerBound) return false
|
||||
if (upperBound != other.upperBound) return false
|
||||
@@ -97,6 +97,16 @@ open class ConeFlexibleType(
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresOptIn(message = "Please use ConeDynamicType.create instead")
|
||||
annotation class DynamicTypeConstructor
|
||||
|
||||
class ConeDynamicType @DynamicTypeConstructor constructor(
|
||||
lowerBound: ConeSimpleKotlinType,
|
||||
upperBound: ConeSimpleKotlinType
|
||||
) : ConeFlexibleType(lowerBound, upperBound), DynamicTypeMarker {
|
||||
companion object
|
||||
}
|
||||
|
||||
fun ConeSimpleKotlinType.unwrapDefinitelyNotNull(): ConeSimpleKotlinType {
|
||||
return when (this) {
|
||||
is ConeDefinitelyNotNullType -> original
|
||||
|
||||
@@ -30,6 +30,11 @@ fun ConeKotlinType.render(): String {
|
||||
is ConeLookupTagBasedType -> {
|
||||
"${renderAttributes()}${lookupTag.name.asString()}"
|
||||
}
|
||||
is ConeDynamicType -> {
|
||||
buildString {
|
||||
append("dynamic")
|
||||
}
|
||||
}
|
||||
is ConeFlexibleType -> {
|
||||
buildString {
|
||||
append("ft<")
|
||||
|
||||
Reference in New Issue
Block a user