t2614.nim 621 B

123456789101112131415161718192021
  1. discard """
  2. cmd: "nim check $options --hints:off $file"
  3. errormsg: ""
  4. nimout: '''
  5. t2614.nim(19, 27) Error: type mismatch: got <array[0..1, proc ()]> but expected 'array[0..1, proc (){.closure.}]'
  6. Calling convention mismatch: got '{.nimcall.}', but expected '{.closure.}'.
  7. t2614.nim(21, 22) Error: type mismatch: got <seq[proc ()]> but expected 'seq[proc (){.closure.}]'
  8. Calling convention mismatch: got '{.nimcall.}', but expected '{.closure.}'.
  9. '''
  10. """
  11. proc g
  12. proc f =
  13. if false: g()
  14. proc g =
  15. if false: f()
  16. var a = [f, g] # This works
  17. var b: array[2, proc()] = [f, g] # Error
  18. var c: seq[proc()] = @[f, g]