feat: implement objects moving and borrowing
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
class A
|
||||
{
|
||||
uint some;
|
||||
}
|
||||
|
||||
fn doSome(A a) A
|
||||
{
|
||||
// NOTE: section below won't change `a.some` value
|
||||
|
||||
// if (a.some < 1)
|
||||
// {
|
||||
// a.some = 1;
|
||||
// return a;
|
||||
// }
|
||||
a.some = 1;
|
||||
|
||||
return a;
|
||||
}
|
||||
|
||||
A a = new A;
|
||||
a.some = 0;
|
||||
printline(a);
|
||||
|
||||
a = doSome(a);
|
||||
printline(a);
|
||||
|
||||
Reference in New Issue
Block a user