t15949.nim 499 B

123456789101112131415161718192021
  1. # bug #15949
  2. discard """
  3. errormsg: "parameter 'a' requires a type"
  4. nimout: '''
  5. t15949.nim(20, 14) Error: parameter 'a' requires a type'''
  6. """
  7. # line 10
  8. proc procGood(a, b = 1): (int, int) = (a, b)
  9. doAssert procGood() == (1, 1)
  10. doAssert procGood(b = 3) == (1, 3)
  11. doAssert procGood(a = 2) == (2, 1)
  12. doAssert procGood(a = 5, b = 6) == (5, 6)
  13. # The type (and default value propagation breaks in the below example
  14. # as semicolon is used instead of comma.
  15. proc procBad(a; b = 1): (int, int) = (a, b)