summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2018-09-03 16:07:35 +0200
committerAraq <rumpf_a@web.de>2018-09-03 16:07:44 +0200
commit0694c9080f85b59e86ddfb0bd3c799fe9d9e30ae (patch)
treeb150f0a27b07303b8394360258b3d9023ddf2983 /tests
parente63c66b8104225cefe0413471410ef4c072f9954 (diff)
downloadNim-0694c9080f85b59e86ddfb0bd3c799fe9d9e30ae.tar.gz
fixes #8043
Diffstat (limited to 'tests')
-rw-r--r--tests/errmsgs/tunknown_named_parameter.nim24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/errmsgs/tunknown_named_parameter.nim b/tests/errmsgs/tunknown_named_parameter.nim
new file mode 100644
index 000000000..b6b855136
--- /dev/null
+++ b/tests/errmsgs/tunknown_named_parameter.nim
@@ -0,0 +1,24 @@
+discard """
+cmd: "nim check $file"
+errormsg: "type mismatch: got <string, set[char], maxsplits: int literal(1)>"
+nimout: '''
+proc rsplit(s: string; sep: string; maxsplit: int = -1): seq[string]
+  first type mismatch at position: 2
+  required type: string
+  but expression '{':'}' is of type: set[char]
+proc rsplit(s: string; sep: char; maxsplit: int = -1): seq[string]
+  first type mismatch at position: 2
+  required type: char
+  but expression '{':'}' is of type: set[char]
+proc rsplit(s: string; seps: set[char] = Whitespace; maxsplit: int = -1): seq[string]
+  first type mismatch at position: 3
+  unknown named parameter: maxsplits
+
+expression: rsplit("abc:def", {':'}, maxsplits = 1)
+'''
+"""
+
+# bug #8043
+
+import strutils
+"abc:def".rsplit({':'}, maxsplits = 1)