Fir2IrLazyProperty: drop redundant error type check

This commit is contained in:
Mikhail Glukhikh
2023-06-26 15:00:54 +03:00
committed by Space Team
parent 0e6a7bbe82
commit 09175c7d56
@@ -106,8 +106,7 @@ class Fir2IrLazyProperty(
}
// Setting initializers to every other class causes some cryptic errors in lowerings
initializer is FirConstExpression<*> -> {
// TODO: Normally we shouldn't have error type here
val constType = with(typeConverter) { initializer.typeRef.toIrType().takeIf { it !is IrErrorType } ?: type }
val constType = with(typeConverter) { initializer.typeRef.toIrType() }
factory.createExpressionBody(initializer.toIrConst(constType))
}
else -> null