FIR2IR: drop error type check in createIrProperty
This commit is contained in:
committed by
Space Team
parent
595aace885
commit
2c0c9e5b5c
+1
-2
@@ -985,8 +985,7 @@ class Fir2IrDeclarationStorage(
|
|||||||
property.name, property.isVal, initializer, typeToUse
|
property.name, property.isVal, initializer, typeToUse
|
||||||
).also { field ->
|
).also { field ->
|
||||||
if (initializer is FirConstExpression<*>) {
|
if (initializer is FirConstExpression<*>) {
|
||||||
// TODO: Normally we shouldn't have error type here
|
val constType = initializer.typeRef.toIrType()
|
||||||
val constType = initializer.typeRef.toIrType().takeIf { it !is IrErrorType } ?: typeToUse
|
|
||||||
field.initializer = factory.createExpressionBody(initializer.toIrConst(constType))
|
field.initializer = factory.createExpressionBody(initializer.toIrConst(constType))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user