This commit is contained in:
Sergey Bogolepov
2018-08-14 18:32:04 +03:00
committed by Sergey Bogolepov
parent 4a46102658
commit b79301d572
3 changed files with 18 additions and 1 deletions
@@ -74,7 +74,10 @@ internal class PostInlineLowering(val context: Context) : FileLoweringPass {
override fun visitCall(expression: IrCall): IrExpression {
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
// vararg lowering will not affect it.
val args = expression.getValueArgument(0) as? IrVararg
+5
View File
@@ -1462,6 +1462,11 @@ task if_else(type: RunKonanTest) {
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) {
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])
}