FIR: minor cone types refactoring

This commit is contained in:
Mikhail Glukhikh
2018-03-22 10:46:30 +03:00
parent 4d48c40832
commit dfa8c32c5d
3 changed files with 10 additions and 12 deletions
@@ -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>,