feat: implement objects moving and borrowing

This commit is contained in:
samsonium
2026-10-17 19:24:03 +03:00
parent 2d307d9d42
commit 645120eda6
10 changed files with 432 additions and 41 deletions
+26
View File
@@ -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);