[K/N] Disable scope initialization on constant access

^KT-57098
This commit is contained in:
Pavel Kunyavskiy
2023-03-10 15:30:48 +01:00
committed by Space Team
parent e6297f92fa
commit 62fb3df7f0
18 changed files with 98 additions and 8 deletions
@@ -33,7 +33,9 @@ abstract class InlineConstTransformer : IrElementTransformerVoid() {
abstract fun reportInlineConst(field: IrField, value: IrConst<*>)
abstract fun IrExpression.shouldDropConstReceiver(): Boolean
fun IrExpression.shouldDropConstReceiver(): Boolean {
return this is IrConst<*> || this is IrGetValue || this is IrGetObjectValue
}
override fun visitCall(expression: IrCall): IrExpression {
val function = (expression.symbol.owner as? IrSimpleFunction) ?: return super.visitCall(expression)
@@ -50,6 +50,4 @@ private class JvmInlineConstTransformer(val irFile: IrFile, val inlineConstTrack
inlineConstTracker.report(path, owner, name, constType)
}
override fun IrExpression.shouldDropConstReceiver() = this is IrConst<*> || this is IrGetValue || this is IrGetObjectValue
}