Files
kotlin-fork/plugins/noarg/noarg-cli/testData/box/localClassInInitiailzer.kt
T
Alexander Udalov 25c228297a JVM IR: support noarg compiler plugin
#KT-41265 Fixed
2020-12-04 22:12:58 +01:00

21 lines
365 B
Kotlin
Vendored

// WITH_RUNTIME
// INVOKE_INITIALIZERS
annotation class NoArg
@NoArg
class Test(val a: String) {
val lc = run {
class Local(val result: String)
Local("OK").result
}
val obj = object { val result = "OK" }.result
}
fun box(): String {
val t = Test::class.java.newInstance()
if (t.lc != "OK") return "Fail 1"
return t.obj
}