summary refs log tree commit diff stats
path: root/tests/varres
diff options
context:
space:
mode:
Diffstat (limited to 'tests/varres')
-rw-r--r--tests/varres/twrong_parameter.nim12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/varres/twrong_parameter.nim b/tests/varres/twrong_parameter.nim
new file mode 100644
index 000000000..34b0c7464
--- /dev/null
+++ b/tests/varres/twrong_parameter.nim
@@ -0,0 +1,12 @@
+discard """
+  line: 6
+  errormsg: "'x' is not the first parameter; context: 'x'"
+"""
+
+proc forward(abc: int; x: var int): var int = result = x
+
+proc foo(): var int =
+  var y = 9
+  result = forward(45, y)
+
+echo foo()