FIR renderer: extract separate ConeTypeRenderer

This commit is contained in:
Mikhail Glukhikh
2022-07-05 11:56:50 +02:00
committed by Space
parent 591143be7c
commit a82baf87cb
46 changed files with 438 additions and 266 deletions
@@ -519,7 +519,7 @@ interface ConeInferenceContext : TypeSystemInferenceExtensionContext, ConeTypeCo
override fun KotlinTypeMarker.getFunctionalTypeFromSupertypes(): KotlinTypeMarker {
require(this is ConeKotlinType)
assert(this.isBuiltinFunctionalTypeOrSubtype()) {
"Not a function type or subtype: ${this.render()}"
"Not a function type or subtype: ${this.renderForDebugging()}"
}
return fullyExpandedType(session).let {
@@ -122,7 +122,7 @@ fun <T : ConeKotlinType> T.withArguments(arguments: Array<out ConeTypeProjection
is ConeErrorType -> this
is ConeClassLikeTypeImpl -> ConeClassLikeTypeImpl(lookupTag, arguments, nullability.isNullable) as T
is ConeDefinitelyNotNullType -> ConeDefinitelyNotNullType(original.withArguments(arguments)) as T
else -> error("Not supported: $this: ${this.render()}")
else -> error("Not supported: $this: ${this.renderForDebugging()}")
}
}
@@ -154,7 +154,7 @@ fun <T : ConeKotlinType> T.withAttributes(attributes: ConeAttributes): T {
// Attributes for stub types are not supported, and it's not obvious if it should
is ConeStubType -> this
is ConeIntegerLiteralType -> this
else -> error("Not supported: $this: ${this.render()}")
else -> error("Not supported: $this: ${this.renderForDebugging()}")
} as T
}