Improve object init order. (#187)
This commit is contained in:
@@ -834,6 +834,11 @@ task initializers4(type: RunKonanTest) {
|
||||
source = "runtime/basic/initializers4.kt"
|
||||
}
|
||||
|
||||
task initializers5(type: RunKonanTest) {
|
||||
goldValue = "42\n"
|
||||
source = "runtime/basic/initializers5.kt"
|
||||
}
|
||||
|
||||
task expression_as_statement(type: RunKonanTest) {
|
||||
goldValue = "Ok\n"
|
||||
source = "codegen/basics/expression_as_statement.kt"
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
object A {
|
||||
val a = 42
|
||||
val b = A.a
|
||||
}
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
println(A.b)
|
||||
}
|
||||
@@ -440,9 +440,9 @@ OBJ_GETTER(InitInstance,
|
||||
|
||||
AllocInstance(type_info, hint, OBJ_RESULT);
|
||||
ObjHeader* object = *OBJ_RESULT;
|
||||
UpdateGlobalRef(location, object);
|
||||
try {
|
||||
ctor(object);
|
||||
UpdateGlobalRef(location, object);
|
||||
#if CONCURRENT
|
||||
// TODO: locking or smth lock-free in MT case?
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user