summary refs log tree commit diff stats
path: root/tests/views
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2021-09-22 15:07:36 +0200
committerGitHub <noreply@github.com>2021-09-22 15:07:36 +0200
commit6163bdd279a2c33d4290223cc7f466c8070b8ce4 (patch)
tree023a95eda4ded4c8b91d0b95340fa2bbb7536f05 /tests/views
parent0ad601d3c1657216d27be839173861594e3e2421 (diff)
downloadNim-6163bdd279a2c33d4290223cc7f466c8070b8ce4.tar.gz
closes #16132 [backport] (#18880)
* closes #16132 [backport]

* fixes #16132 [backport]
Diffstat (limited to 'tests/views')
-rw-r--r--tests/views/tviews1.nim14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/views/tviews1.nim b/tests/views/tviews1.nim
index 51f17b9d6..49d79c5b5 100644
--- a/tests/views/tviews1.nim
+++ b/tests/views/tviews1.nim
@@ -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