Files
kotlin-fork/compiler/testData/codegen/box/inlineClasses/contextsAndAccessors/kt30780.kt
T
Dmitry Petrov bbeb65905e KT-30780 Fix erased inline class context in class context hierarchy
In SourceCompilerForInline we could enter ERASED_INLINE_CLASS context
from containing declaration context. That broke codegen context
hierarchy invariants assumed in accessor generation.
2019-04-05 17:27:04 +03:00

16 lines
320 B
Kotlin
Vendored

// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND: JVM_IR
inline class Test(val x: Int) {
private companion object {
private const val CONSTANT = "OK"
}
fun crash() = getInlineConstant()
private inline fun getInlineConstant(): String {
return CONSTANT
}
}
fun box() = Test(1).crash()