From 75bb38a10c9fa069cfbc731a1f50e4f977447987 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 1 Nov 2025 12:58:52 -0400 Subject: Fix case where `foo.baz.method()` failed to pass `baz` as `(&(foo.baz))` when `foo` was a `&Foo` and `baz.method()` takes a `&Baz`. --- test/pointers.tm | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test/pointers.tm (limited to 'test/pointers.tm') 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 -- cgit v1.2.3