Fix for KT-11117: Android Kotlin DEX transformation error when I use arrayOf as an anonymous object property
#KT-11117 Fixed
This commit is contained in:
@@ -795,6 +795,9 @@ public class FunctionCodegen {
|
||||
if (receiverParameter != null) {
|
||||
frameMap.enter(receiverParameter, state.getTypeMapper().mapType(receiverParameter));
|
||||
}
|
||||
else {
|
||||
frameMap.enterTemp(parameter.getAsmType());
|
||||
}
|
||||
}
|
||||
else if (parameter.getKind() != JvmMethodParameterKind.VALUE) {
|
||||
frameMap.enterTemp(parameter.getAsmType());
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
class A(val value: String)
|
||||
|
||||
fun A.test(): String {
|
||||
val o = object {
|
||||
val z: String
|
||||
init {
|
||||
val x = value + "K"
|
||||
z = x
|
||||
}
|
||||
}
|
||||
return o.z
|
||||
}
|
||||
|
||||
// METHOD : Kt11117Kt$test$o$1.<init>(LA;)V
|
||||
// VARIABLE : NAME=x TYPE=Ljava/lang/String; INDEX=2
|
||||
// VARIABLE : NAME=this TYPE=LKt11117Kt$test$o$1; INDEX=0
|
||||
// VARIABLE : NAME=$receiver TYPE=LA; INDEX=1
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
class A(val value: String)
|
||||
|
||||
fun A.test(): String {
|
||||
val o = object {
|
||||
val z: String
|
||||
init {
|
||||
val x = value + "K"
|
||||
z = x
|
||||
}
|
||||
}
|
||||
return o.z
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return A("O").test()
|
||||
}
|
||||
@@ -5677,6 +5677,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt11117.kt")
|
||||
public void testKt11117() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/kt11117.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt1136.kt")
|
||||
public void testKt1136() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/kt1136.kt");
|
||||
|
||||
@@ -89,6 +89,12 @@ public class CheckLocalVariablesTableTestGenerated extends AbstractCheckLocalVar
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt11117.kt")
|
||||
public void testKt11117() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/checkLocalVariablesTable/kt11117.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("lambdaAsVar.kt")
|
||||
public void testLambdaAsVar() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/checkLocalVariablesTable/lambdaAsVar.kt");
|
||||
|
||||
Reference in New Issue
Block a user