closes #16132 [backport] (#18880)

* closes #16132 [backport]

* fixes #16132 [backport]
This commit is contained in:
Andreas Rumpf 2021-09-22 15:07:36 +02:00 • committed by GitHub
commit 6163bdd279
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 6 deletions

View file

@ -5,7 +5,8 @@ discard """
3
2
3
3'''
3
15'''
targets: "c cpp"
"""
@ -26,3 +27,14 @@ proc main(s: seq[int]) =
take x
main(@[11, 22, 33])
var x: int
proc foo(x: var int): var int =
once: x = 42
return x
var y: var int = foo(x)
y = 15
echo foo(x)
# bug #16132