Files
kotlin/compiler/testData/codegen/bytecodeText/inlineClasses/factoryMethodForSecondaryConstructorsCalledByInlineClass.kt
Dmitry Petrov cafaa3e13c Mangle inline class members
<IMPL_SUFFIX> for method is a method signature hash,
if method value parameter types contain inline class types,
otherwise 'impl'.

Constructor methods are named as 'constructor-<IMPL_SUFFIX>'.

Synthesized 'box' and 'unbox' methods are named as
'<METHOD_NAME>-<IMPL_SUFFIX>'.

Erased implementations of overriding and non-overriding methods
are named as '<METHOD_NAME>-<IMPL_SUFFIX>'.

Fully specialized implementation of 'equals' will have a special suffix.
2018-09-07 10:25:53 +03:00

20 lines
547 B
Kotlin
Vendored

// !LANGUAGE: +InlineClasses
// FILE: Z.kt
inline class Z(val x: Int) {
constructor(x: Long) : this(x.toInt())
constructor(s: String) : this(s.length)
constructor(a: Int, b: Int) : this(a + b)
}
// FILE: test.kt
fun test1() = Z(0L)
fun test2() = Z("abcdef")
fun test3() = Z(1, 2)
// @TestKt.class:
// 0 INVOKESTATIC Z\$Erased\.constructor
// 0 INVOKESTATIC Z\-Erased\.constructor
// 1 INVOKESTATIC Z\.constructor-impl \(J\)I
// 1 INVOKESTATIC Z\.constructor-impl \(Ljava/lang/String;\)I
// 1 INVOKESTATIC Z\.constructor-impl \(II\)I