summary refs log tree commit diff stats
path: root/tests/let/tlet2.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/let/tlet2.nim')
-rw-r--r--tests/let/tlet2.nim15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/let/tlet2.nim b/tests/let/tlet2.nim
new file mode 100644
index 000000000..63e7d6128
--- /dev/null
+++ b/tests/let/tlet2.nim
@@ -0,0 +1,15 @@
+discard """
+  errormsg: "type mismatch: got <int literal(8), int literal(5), int, int>"
+  line: "13"
+"""
+
+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)