FIR2IR strip annotations from IrConst type

This commit is contained in:
Dmitry Petrov
2021-11-22 17:51:07 +03:00
committed by Space
parent 0048540652
commit 2a263eca65
8 changed files with 20 additions and 8 deletions
@@ -71,6 +71,18 @@ fun IrType.removeAnnotations(predicate: (IrConstructorCall) -> Boolean): IrType
this
}
fun IrType.removeAnnotations(): IrType =
when (this) {
is IrSimpleType ->
toBuilder().apply {
annotations = emptyList()
}.buildSimpleType()
is IrDynamicType ->
IrDynamicTypeImpl(null, emptyList(), Variance.INVARIANT)
else ->
this
}
val IrType.classifierOrFail: IrClassifierSymbol
get() = cast<IrSimpleType>().classifier