parent
4def86f077
commit
51dd4b7601
2 changed files with 42 additions and 13 deletions
32
tests/js/tbyvar.nim
Normal file
32
tests/js/tbyvar.nim
Normal file
|
|
@ -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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue