mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
We might want to add 'init' blocks later, so now, for the sake of binary compatibility with 1.3-RC binaries, we have to generate these 'constructor' calls. Note that in some tests inline class boxing is no longer redundant, because resulting value is passed to 'constructor' as an argument.
24 lines
435 B
Kotlin
Vendored
24 lines
435 B
Kotlin
Vendored
// !LANGUAGE: +InlineClasses
|
|
|
|
// FILE: utils.kt
|
|
|
|
inline class Result<T>(val a: Any?)
|
|
|
|
// FILE: test.kt
|
|
|
|
fun test() {
|
|
val a = Result<Int>(1) // valueOf
|
|
val b = Result<String>("sample")
|
|
|
|
val c = Result<Result<Int>>(a)
|
|
val d = Result<Result<Int>>(Result<Int>(1)) // valueOf
|
|
}
|
|
|
|
// @TestKt.class:
|
|
// 0 INVOKESTATIC Result\$Erased.box
|
|
// 2 INVOKESTATIC Result\.box
|
|
// 0 INVOKEVIRTUAL Result.unbox
|
|
|
|
// 2 valueOf
|
|
// 0 intValue
|