From 0a87c4663fc52bf60f3d440200b3b3ad6b39bd3e Mon Sep 17 00:00:00 2001 From: zinc Date: Thu, 15 Oct 2026 09:48:10 +0330 Subject: analyzer: use-after-end messages name the borrower, the owner and how the owner ended (freed, moved, .d parameter, push, global, reassignment), with fixtures --- tests/errors/use_after_push.zc | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/errors/use_after_push.zc (limited to 'tests/errors/use_after_push.zc') diff --git a/tests/errors/use_after_push.zc b/tests/errors/use_after_push.zc new file mode 100644 index 0000000..a4baf69 --- /dev/null +++ b/tests/errors/use_after_push.zc @@ -0,0 +1,10 @@ +namespace; +include rt; + +// expect: a: used after it was given away; a was pushed into an array on line 8 (declared on line 7) +fn main() { + word[?] items = rt.new(word[?]); + let a = rt.new(4); + push(items, a); + return a[0]; +} -- cgit v1.2.3