FIR: minor cone types refactoring
This commit is contained in:
@@ -15,7 +15,6 @@ enum class ProjectionKind {
|
||||
STAR, IN, OUT, INVARIANT
|
||||
}
|
||||
|
||||
|
||||
object StarProjection : ConeKotlinTypeProjection(ProjectionKind.STAR)
|
||||
|
||||
abstract class ConeKotlinTypeProjectionIn : ConeKotlinTypeProjection(ProjectionKind.IN) {
|
||||
@@ -26,9 +25,17 @@ abstract class ConeKotlinTypeProjectionOut : ConeKotlinTypeProjection(Projection
|
||||
abstract val type: ConeKotlinType
|
||||
}
|
||||
|
||||
abstract class ConeKotlinType : ConeKotlinTypeProjection(ProjectionKind.INVARIANT)
|
||||
// We assume type IS an invariant type projection to prevent additional wrapper here
|
||||
// (more exactly, invariant type projection contains type)
|
||||
sealed class ConeKotlinType : ConeKotlinTypeProjection(ProjectionKind.INVARIANT)
|
||||
|
||||
abstract class ConeSymbolBasedType : ConeKotlinType() {
|
||||
class ConeKotlinErrorType(val reason: String) : ConeKotlinType() {
|
||||
override fun toString(): String {
|
||||
return "<ERROR TYPE: $reason>"
|
||||
}
|
||||
}
|
||||
|
||||
sealed class ConeSymbolBasedType : ConeKotlinType() {
|
||||
abstract val symbol: ConeSymbol
|
||||
}
|
||||
|
||||
|
||||
@@ -18,13 +18,6 @@ class ConeKotlinTypeProjectionInImpl(override val type: ConeKotlinType) : ConeKo
|
||||
|
||||
class ConeKotlinTypeProjectionOutImpl(override val type: ConeKotlinType) : ConeKotlinTypeProjectionOut()
|
||||
|
||||
class ConeKotlinErrorType(val reason: String) : ConeKotlinType() {
|
||||
|
||||
override fun toString(): String {
|
||||
return "<ERROR TYPE: $reason>"
|
||||
}
|
||||
}
|
||||
|
||||
class ConeAbbreviatedTypeImpl(
|
||||
override val abbreviationSymbol: ConeClassLikeSymbol,
|
||||
override val typeArguments: List<ConeKotlinTypeProjection>,
|
||||
|
||||
@@ -13,7 +13,6 @@ import org.jetbrains.kotlin.fir.symbols.ConeClassLikeSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.fir.types.*
|
||||
import org.jetbrains.kotlin.fir.types.impl.ConeKotlinErrorType
|
||||
import org.jetbrains.kotlin.fir.visitors.FirVisitorVoid
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
import org.jetbrains.kotlin.utils.Printer
|
||||
@@ -453,7 +452,6 @@ class FirRenderer(builder: StringBuilder) : FirVisitorVoid() {
|
||||
is ConeTypeParameterType -> {
|
||||
symbol.asString()
|
||||
}
|
||||
else -> "Unsupported: $this"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user