tunknown_named_parameter.nim 765 B

12345678910111213141516171819202122232425
  1. discard """
  2. cmd: "nim check $file"
  3. errormsg: "type mismatch: got <string, set[char], maxsplits: int literal(1)>"
  4. nimout: '''
  5. proc rsplit(s: string; sep: string; maxsplit: int = -1): seq[string]
  6. first type mismatch at position: 2
  7. required type: string
  8. but expression '{':'}' is of type: set[char]
  9. proc rsplit(s: string; sep: char; maxsplit: int = -1): seq[string]
  10. first type mismatch at position: 2
  11. required type: char
  12. but expression '{':'}' is of type: set[char]
  13. proc rsplit(s: string; seps: set[char] = Whitespace; maxsplit: int = -1): seq[string]
  14. first type mismatch at position: 3
  15. unknown named parameter: maxsplits
  16. expression: rsplit("abc:def", {':'}, maxsplits = 1)
  17. '''
  18. """
  19. # bug #8043
  20. import strutils
  21. "abc:def".rsplit({':'}, maxsplits = 1)