KT-52743 IR: Fix null checks in Elvis operators

This commit is contained in:
Pavel Mikhailovskii
2022-06-20 18:51:46 +02:00
committed by teamcity
parent ed97e73129
commit 3766698081
11 changed files with 60 additions and 2 deletions
@@ -596,6 +596,10 @@ fun IrExpression.isTrivial() =
this is IrGetObjectValue ||
this is IrErrorExpressionImpl
val IrExpression.isConstantLike: Boolean
get() = this is IrConst<*> || this is IrGetSingletonValue
|| this is IrGetValue && this.symbol.owner.origin == IrDeclarationOrigin.INSTANCE_RECEIVER
fun IrExpression.shallowCopy(): IrExpression =
shallowCopyOrNull()
?: error("Not a copyable expression: ${render()}")