From ecc350ca5c2eb50be8309c5f14f8bf0d87db9a02 Mon Sep 17 00:00:00 2001 From: Moon Flower Date: Mon, 12 Oct 2026 08:46:23 +0330 Subject: a --- tests/programs/infer_return.zc | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 tests/programs/infer_return.zc (limited to 'tests/programs/infer_return.zc') diff --git a/tests/programs/infer_return.zc b/tests/programs/infer_return.zc new file mode 100644 index 0000000..a9f12bd --- /dev/null +++ b/tests/programs/infer_return.zc @@ -0,0 +1,3 @@ +// a owned return with no .u on the signature: the return type is inferred from the body +fn mk(v) { int* p = new(1); p[0] = v; return p; } +fn main() { int* q = mk(3); put_n(q[0]); put_c(10); return 0; } -- cgit v1.2.3