ttypeAllowed.nim 929 B

1234567891011121314151617181920212223242526272829
  1. discard """
  2. cmd: "nim check $file"
  3. errormsg: ""
  4. nimout: '''
  5. ttypeAllowed.nim(13, 5) Error: invalid type: 'iterator (a: int, b: int, step: Positive): int{.inline, noSideEffect, gcsafe.}' for let
  6. ttypeAllowed.nim(17, 7) Error: invalid type: 'iterator (a: int, b: int, step: Positive): int{.inline, noSideEffect, gcsafe.}' for const
  7. ttypeAllowed.nim(21, 5) Error: invalid type: 'iterator (a: int, b: int, step: Positive): int{.inline, noSideEffect, gcsafe.}' for var
  8. ttypeAllowed.nim(26, 10) Error: invalid type: 'iterator (a: int, b: int, step: Positive): int{.inline, noSideEffect, gcsafe.}' for result
  9. '''
  10. """
  11. let f1 = case true
  12. of true: countup[int]
  13. of false: countdown[int]
  14. const f2 = case true
  15. of true: countup[int]
  16. of false: countdown[int]
  17. var f3 = case true
  18. of true: countup[int]
  19. of false: countdown[int]
  20. proc foobar(): auto =
  21. result = case true
  22. of true: countup[int]
  23. of false: countdown[int]