diff options
| author | 2026-10-15 15:19:17 +0330 | |
|---|---|---|
| committer | 2026-10-15 15:19:17 +0330 | |
| commit | d36190a5f3b8fa33fe3381771cd1efb9a1335e50 (patch) | |
| tree | d6b29e4720aa0a4b5bd54c7deee9a58fd622d25c /tests/conformance | |
| parent | lsp test: block-end borrow message and related info (diff) | |
prescan: guess an owned return only from a local declared from new/heap, not a global assigned one (fixes lsp self-check); xref baseline for the new writers
Diffstat (limited to 'tests/conformance')
| -rw-r--r-- | tests/conformance/6-ownership/infer_owned_return_global_not_owned.zc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/conformance/6-ownership/infer_owned_return_global_not_owned.zc b/tests/conformance/6-ownership/infer_owned_return_global_not_owned.zc new file mode 100644 index 0000000..5d7f793 --- /dev/null +++ b/tests/conformance/6-ownership/infer_owned_return_global_not_owned.zc @@ -0,0 +1,7 @@ +// expect: 3/ +// spec 6.8 +include rt; +int* cache; +int* refill() { cache = rt.new(int); *cache = 3; return cache; } +fn main() { refill(); rt.put_n(*cache); rt.put_c(10); } +// zc0: skip |
