999604541e
Put their content to constructor-impl, so they are called during constructor call, but they are not called during boxing, because box-impl calls <init> and not constructor-impl. #KT-28055 In progress
24 lines
367 B
Kotlin
Vendored
24 lines
367 B
Kotlin
Vendored
// IGNORE_BACKEND: JVM
|
|
// IGNORE_BACKEND: JS_IR
|
|
// IGNORE_LIGHT_ANALYSIS
|
|
|
|
inline class IC(val i: Int) {
|
|
init {
|
|
counter += i
|
|
}
|
|
}
|
|
|
|
var counter = 0
|
|
|
|
fun <T> id(t: T) = t
|
|
|
|
fun box(): String {
|
|
val ic = IC(42)
|
|
if (counter != 42) return "FAIL 1: $counter"
|
|
counter = 0
|
|
|
|
id(ic)
|
|
if (counter != 0) return "FAIL 2: $counter"
|
|
|
|
return "OK"
|
|
} |