summary refs log tree commit diff stats
path: root/tests/let/tlet2.nim
blob: 2df15fa5ca9571f4f5a70f54701d28db6c9f9cb7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
discard """
  line: "13"
  errormsg: "type mismatch: got <int literal(8), int literal(5), int, int>"
"""

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)