K2: add test confirming successful work of KT-56261

This commit is contained in:
Mikhail Glukhikh
2023-02-07 17:15:33 +01:00
committed by Space Team
parent 314784f435
commit 2405f28e64
6 changed files with 52 additions and 0 deletions
@@ -0,0 +1,19 @@
FILE: localVariableInSecondaryConstructor.kt
public final fun main(): R|kotlin/Unit| {
lval localVariable: R|kotlin/Int| = Int(0)
local final class LocalClass : R|kotlin/Any| {
public constructor(arg: R|kotlin/Int|): R|LocalClass| {
super<R|kotlin/Any|>()
}
public final val arg: R|kotlin/Int| = R|<local>/arg|
public get(): R|kotlin/Int|
public constructor(): R|LocalClass| {
this<R|LocalClass|>(R|<local>/localVariable|)
}
}
R|/LocalClass.LocalClass|().R|<local>/arg|
}
@@ -0,0 +1,10 @@
fun main() {
val localVariable = 0
class LocalClass(val arg: Int) {
constructor() : this(localVariable)
}
LocalClass().arg
}