summary refs log tree commit diff stats
path: root/tests/errmsgs
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-02-04 07:04:50 +0100
committerAndreas Rumpf <rumpf_a@web.de>2018-02-04 07:04:50 +0100
commit326b7dc5562d3f3d2b5848723ceaeba5b8182be1 (patch)
tree21687943d41feaf38880bcd95ebcfc4e77dc44c9 /tests/errmsgs
parentb4eff82e62883d307db83f3e875be2e1b521b0ff (diff)
downloadNim-326b7dc5562d3f3d2b5848723ceaeba5b8182be1.tar.gz
improve the error messages regarding type mismatches in overloading resolution
Diffstat (limited to 'tests/errmsgs')
-rw-r--r--tests/errmsgs/tdetailed_position.nim22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/errmsgs/tdetailed_position.nim b/tests/errmsgs/tdetailed_position.nim
new file mode 100644
index 000000000..d6db94c3e
--- /dev/null
+++ b/tests/errmsgs/tdetailed_position.nim
@@ -0,0 +1,22 @@
+
+discard """
+cmd: "nim check $file"
+errormsg: "type mismatch: got (int literal(1), int literal(2), int literal(3))"
+nimout: '''
+but expected one of:
+proc main(a, b, c: string)
+first type mismatch at position: 1
+required type: string
+but expression '1' is of type: int literal(1)
+
+expression: main(1, 2, 3)
+'''
+"""
+
+const
+  myconst = "abcdefghijklmnopqrstuvwxyz"
+
+proc main(a, b, c: string) {.deprecated: "use foo " & "instead " & myconst.} =
+  return
+
+main(1, 2, 3)