[K/N] Call class static initializer in constructors
^KT-59058
This commit is contained in:
committed by
Space Team
parent
c40bf720d9
commit
12455451fc
+10
-8
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user