Added automatic distructor calling for going out of scope, found out that += is broken (and just comes through as =)
This commit is contained in:
@@ -17,8 +17,8 @@ obj Something (ObjectTrait) {
|
||||
member = old->member
|
||||
}
|
||||
fun destruct() {
|
||||
simple_println("Destructing a Something")
|
||||
member = -800
|
||||
simple_print("Destructing a Something: ")
|
||||
simple_println(member)
|
||||
}
|
||||
fun method(a: int):int {
|
||||
return 5+a+member + other_method()
|
||||
@@ -107,6 +107,7 @@ fun main(): int {
|
||||
simple_println(test_methods.member)
|
||||
simple_println(test_methods_param.member)
|
||||
var second_obj = test_methods
|
||||
second_obj.member += 5
|
||||
simple_println(second_obj.member)
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user