diff options
| author | 2026-10-15 11:29:26 +0330 | |
|---|---|---|
| committer | 2026-10-15 11:29:26 +0330 | |
| commit | a3f769ea02b5686084c5b3c2a382b9934b535050 (patch) | |
| tree | 47caed7e1bc49dbb9ee7aecd76f88c2048963f21 /tests/errors/use_after_global.zc | |
| parent | merge work/stdio: std.Io and one-level module completion (diff) | |
| parent | xref: baseline records the borrow globals (end_why, end_whom, arg_site, local... (diff) | |
merge work/borrow: borrow returns before definition, borrows clause, borrow messages and LSP diagnostics, mkgenome header mismatch values
Diffstat (limited to 'tests/errors/use_after_global.zc')
| -rw-r--r-- | tests/errors/use_after_global.zc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/errors/use_after_global.zc b/tests/errors/use_after_global.zc new file mode 100644 index 0000000..01a69c0 --- /dev/null +++ b/tests/errors/use_after_global.zc @@ -0,0 +1,10 @@ +namespace; +include rt; + +// expect: a: used after it was given away; a was stored in a global or untracked memory on line 8 (declared on line 7) +word g; +fn main() { + let a = rt.new(4); + g = a; + return a[0]; +} |
