Improve object init order. (#187)

This commit is contained in:
Nikolay Igotti
2017-01-20 13:31:01 +03:00
committed by GitHub
parent 0e05d3b30a
commit 1c878e4843
3 changed files with 14 additions and 1 deletions
+5
View File
@@ -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)
}
+1 -1
View File
@@ -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