diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/pointers.tm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/pointers.tm b/test/pointers.tm new file mode 100644 index 00000000..9834044c --- /dev/null +++ b/test/pointers.tm @@ -0,0 +1,13 @@ +struct Foo(x:Int) + func update(f:&Foo) + f.x += 1 + +struct Baz(foo:Foo) + func update(b:&Baz) + # Make sure & propagates here! + b.foo.update() + +func main() + b := Baz(Foo(123)) + b.update() + assert b.foo.x == 124 |
