summary refs log tree commit diff stats
path: root/tests/errmsgs/tunknown_named_parameter.nim
blob: e9be230681d4284847472faccf8eed7bdef40519 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
discard """
cmd: "nim check $file"
errormsg: "type mismatch: got <string, set[char], maxsplits: int literal(1)>"
nimout: '''
proc rsplit(s: string; sep: char; maxsplit: int = -1): seq[string]
  first type mismatch at position: 2
  required type for sep: 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
proc rsplit(s: string; sep: string; maxsplit: int = -1): seq[string]
  first type mismatch at position: 2
  required type for sep: string
  but expression '{':'}' is of type: set[char]

expression: rsplit("abc:def", {':'}, maxsplits = 1)
'''
disabled: 32bit
"""

# bug #8043

# disabled on 32 bit systems because the order of suggested proc alternatives is different.

import strutils
"abc:def".rsplit({':'}, maxsplits = 1)