tlet2.nim 323 B

12345678910111213141516
  1. discard """
  2. errormsg: "type mismatch: got <int literal(8), int literal(5), int, int>"
  3. line: "13"
  4. """
  5. proc divmod(a, b: int, res, remainder: var int) =
  6. res = a div b # integer division
  7. remainder = a mod b # integer modulo operation
  8. let
  9. x = 9
  10. y = 3
  11. divmod(8, 5, x, y) # modifies x and y
  12. echo(x)
  13. echo(y)