summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-11-28 18:15:06 +0100
committerAraq <rumpf_a@web.de>2014-11-28 18:15:06 +0100
commit51dd4b7601e24ed5997cf5a60d8e7f6f382b5eb1 (patch)
treeca6fc3af15bf8e2f82065466335f0375ef661a30 /tests
parent4def86f077fe659ffd98bd6c1bbc43ad68af6ebb (diff)
downloadNim-51dd4b7601e24ed5997cf5a60d8e7f6f382b5eb1.tar.gz
fixes #1489, fixes #1490
Diffstat (limited to 'tests')
-rw-r--r--tests/js/tbyvar.nim32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/js/tbyvar.nim b/tests/js/tbyvar.nim
new file mode 100644
index 000000000..5ed2de1da
--- /dev/null
+++ b/tests/js/tbyvar.nim
@@ -0,0 +1,32 @@
+discard """
+  output: '''foo 12
+bar 12
+2
+foo 12
+bar 12
+2'''
+"""
+
+# bug #1489
+proc foo(x: int) = echo "foo: ", x
+proc bar(y: var int) = echo "bar: ", y
+
+var x = 12
+foo(x)
+bar(x)
+
+# bug #1490
+var y = 1
+y *= 2
+echo y
+
+proc main =
+  var x = 12
+  foo(x)
+  bar(x)
+
+  var y = 1
+  y *= 2
+  echo y
+
+main()