mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
Write proper start label for inlined constructor parameters (start label was shifted by additional captured parameters injection)
This commit is contained in:
10
compiler/testData/codegen/bytecodeText/jackAndJill/inlinedConstuctor.kt
vendored
Normal file
10
compiler/testData/codegen/bytecodeText/jackAndJill/inlinedConstuctor.kt
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
public inline fun <T> Iterable(crossinline iterator: () -> Iterator<T>): Iterable<T> = object : Iterable<T> {
|
||||
override fun iterator(): Iterator<T> = iterator()
|
||||
}
|
||||
|
||||
public fun IntArray.asIterable(): Iterable<Int> {
|
||||
return Iterable { this.iterator() }
|
||||
}
|
||||
/*Threre are two constuctors so we should be sure that we check required one by checking 'receiver$0$inlined' assign*/
|
||||
// 1 <init>\(\[I\)V\s+L0\s+ALOAD 0\s+ALOAD 1\s+PUTFIELD InlinedConstuctorKt\$asIterable\$\$inlined\$Iterable\$1\.receiver\$0\$inlined : \[I
|
||||
// 1 LOCALVARIABLE this LInlinedConstuctorKt\$asIterable\$\$inlined\$Iterable\$1; L0 L2 0
|
||||
17
compiler/testData/codegen/bytecodeText/jackAndJill/inlinedConstuctorWithSuperCallParams.kt
vendored
Normal file
17
compiler/testData/codegen/bytecodeText/jackAndJill/inlinedConstuctorWithSuperCallParams.kt
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
open class A(val z: String) {
|
||||
|
||||
}
|
||||
|
||||
inline fun test(crossinline s: () -> String) {
|
||||
object : A("123") {
|
||||
val x = s();
|
||||
}
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
var z = "123";
|
||||
test { z }
|
||||
}
|
||||
|
||||
/*Threre are two constuctors so we should be sure that we check LOCALVARIABLEs from same method*/
|
||||
// 1 LOCALVARIABLE this LInlinedConstuctorWithSuperCallParamsKt\$main\$\$inlined\$test\$1; L0 L7 0\s+LOCALVARIABLE \$super_call_param\$1 Ljava/lang/String; L0 L7 1
|
||||
Reference in New Issue
Block a user