Files
kotlin/compiler/testData/codegen/bytecodeText/inlineClasses/propertyAccessorsAreCalledByInlineClass.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

41 lines
798 B
Kotlin
Vendored

// !LANGUAGE: +InlineClasses
// FILE: Z.kt
inline class Z(val x: Int) {
val aVal: Int
get() = x
var aVar: Int
get() = x
set(v) {}
val String.extVal: Int
get() = x
var String.extVar: Int
get() = x
set(v) {}
}
// FILE: test.kt
fun Z.test() {
aVal
aVar
aVar = 42
aVar++
"".extVal
"".extVar
"".extVar = 42
"".extVar++
}
// @TestKt.class:
// 0 INVOKESTATIC Z\$Erased\.
// 0 INVOKESTATIC Z\-Erased\.
// 1 INVOKESTATIC Z.getAVal-impl \(I\)I
// 2 INVOKESTATIC Z.getAVar-impl \(I\)I
// 2 INVOKESTATIC Z.setAVar-impl \(II\)V
// 1 INVOKESTATIC Z.getExtVal-impl \(ILjava/lang/String;\)I
// 2 INVOKESTATIC Z.getExtVar-impl \(ILjava/lang/String;\)I
// 2 INVOKESTATIC Z.setExtVar-impl \(ILjava/lang/String;I\)V