[K/N] Call class static initializer in constructors

^KT-59058
This commit is contained in:
Pavel Kunyavskiy
2023-06-05 12:56:56 +02:00
committed by Space Team
parent c40bf720d9
commit 12455451fc
6 changed files with 46 additions and 28 deletions
@@ -18,14 +18,6 @@ fun getStackTrace() : List<String> {
open class Foo {
open fun foo(): List<String> { return emptyList() }
companion object {
var trace: List<String> = emptyList()
init {
trace = getStackTrace()
}
}
}
private class Bar : Foo() {
@@ -40,6 +32,16 @@ object Object {
}
}
class WithCompanion {
companion object {
var trace: List<String> = emptyList()
init {
trace = getStackTrace()
}
}
}
enum class E {
A {
init {