Fix for #1880
This commit is contained in:
committed by
Sergey Bogolepov
parent
4a46102658
commit
b79301d572
+4
-1
@@ -74,7 +74,10 @@ internal class PostInlineLowering(val context: Context) : FileLoweringPass {
|
|||||||
override fun visitCall(expression: IrCall): IrExpression {
|
override fun visitCall(expression: IrCall): IrExpression {
|
||||||
expression.transformChildrenVoid(this)
|
expression.transformChildrenVoid(this)
|
||||||
|
|
||||||
if (expression.symbol == context.ir.symbols.immutableBinaryBlobOf) {
|
// Function inlining is changing function symbol at callsite
|
||||||
|
// and unbound symbol replacement is happening later.
|
||||||
|
// So we compare descriptors for now.
|
||||||
|
if (expression.descriptor == context.immutableBinaryBlobOf) {
|
||||||
// Convert arguments of the binary blob to special IrConst<String> structure, so that
|
// Convert arguments of the binary blob to special IrConst<String> structure, so that
|
||||||
// vararg lowering will not affect it.
|
// vararg lowering will not affect it.
|
||||||
val args = expression.getValueArgument(0) as? IrVararg
|
val args = expression.getValueArgument(0) as? IrVararg
|
||||||
|
|||||||
@@ -1462,6 +1462,11 @@ task if_else(type: RunKonanTest) {
|
|||||||
source = "codegen/branching/if_else.kt"
|
source = "codegen/branching/if_else.kt"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task immutable_binary_blob_in_lambda(type: RunKonanTest) {
|
||||||
|
source = "lower/immutable_binary_blob_in_lambda.kt"
|
||||||
|
goldValue = "123\n"
|
||||||
|
}
|
||||||
|
|
||||||
task when2(type: RunKonanTest) {
|
task when2(type: RunKonanTest) {
|
||||||
source = "codegen/branching/when2.kt"
|
source = "codegen/branching/when2.kt"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package lower.immutable_binary_blob_in_lambda
|
||||||
|
|
||||||
|
import kotlin.test.*
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun runTest() = run {
|
||||||
|
val golden = immutableBinaryBlobOf(123)
|
||||||
|
println(golden[0])
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user