* fixes #20572

* added a test case
This commit is contained in:
Andreas Rumpf 2022-10-17 23:48:51 +02:00 • committed by GitHub
commit 81087c949f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 116 additions and 70 deletions

View file

@ -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()