summary refs log blame commit diff stats
path: root/tests/reject/tlet2.nim
blob: 8b1ddf9403a2204ffc48f9f0d9dd406aa16623c9 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16















                                                            
discard """
  line: "13"
  errormsg: "for a 'var' type a variable needs to be passed"
"""

proc divmod(a, b: int, res, remainder: var int) =
  res = a div b        # integer division
  remainder = a mod b  # integer modulo operation

let
  x = 9
  y = 3
divmod(8, 5, x, y) # modifies x and y
echo(x)
echo(y)