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.
This commit is contained in:
Dmitry Petrov
2019-04-04 16:56:19 +03:00
parent e1915ec99e
commit bbeb65905e
9 changed files with 67 additions and 12 deletions
@@ -0,0 +1,16 @@
// !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()