diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2022-10-17 23:48:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-17 23:48:51 +0200 |
commit | 81087c949f620dc80697364da414872791ffe23c (patch) | |
tree | 870c578d221484861f485371ebde2fca18d6ca08 /tests/arc | |
parent | c0824b9b80f50807fc41b621760c4b685d1d7497 (diff) | |
download | Nim-81087c949f620dc80697364da414872791ffe23c.tar.gz |
fixes #20572 (#20585)
* fixes #20572 * added a test case
Diffstat (limited to 'tests/arc')
-rw-r--r-- | tests/arc/texplicit_sink.nim | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/arc/texplicit_sink.nim b/tests/arc/texplicit_sink.nim new file mode 100644 index 000000000..4b021ed62 --- /dev/null +++ b/tests/arc/texplicit_sink.nim @@ -0,0 +1,29 @@ +discard """ + output: '''de''' + cmd: '''nim c --mm:arc --expandArc:main $file''' + nimout: '''--expandArc: main + +var + a + b_cursor +try: + a = f "abc" + b_cursor = "de" + `=sink`(a, b_cursor) + echo [a] +finally: + `=destroy`(a) +-- end of expandArc ------------------------''' +""" + +# bug #20572 + +proc f(s: string): string = s + +proc main = + var a = f "abc" + var b = "de" + `=sink`(a, b) + echo a + +main() |