FIR2IR: drop error type check in createIrProperty

This commit is contained in:
Mikhail Glukhikh
2023-06-26 11:37:13 +03:00
committed by Space Team
parent 595aace885
commit 2c0c9e5b5c
@@ -985,8 +985,7 @@ class Fir2IrDeclarationStorage(
property.name, property.isVal, initializer, typeToUse
).also { field ->
if (initializer is FirConstExpression<*>) {
// TODO: Normally we shouldn't have error type here
val constType = initializer.typeRef.toIrType().takeIf { it !is IrErrorType } ?: typeToUse
val constType = initializer.typeRef.toIrType()
field.initializer = factory.createExpressionBody(initializer.toIrConst(constType))
}
}