Added copy_constructing when returning

This commit is contained in:
Nathan Braswell
2016-01-30 22:04:37 -05:00
parent a64e01e828
commit 83450aa833
4 changed files with 46 additions and 25 deletions

View File

@@ -115,6 +115,8 @@ obj type (Object) {
}
return string("impossible type, indirection:") + indirection
}
fun clone_with_increased_indirection(): *type return clone_with_indirection(indirection+1);
fun clone_with_decreased_indirection(): *type return clone_with_indirection(indirection-1);
fun clone_with_indirection(ind: int): *type {
var to_ret = new<type>()
to_ret->copy_construct(this)