tsidee4.nim 346 B

12345678910111213141516
  1. discard """
  2. errormsg: "'noSideEffect' can have side effects"
  3. file: "tsidee4.nim"
  4. line: 12
  5. """
  6. var
  7. global: int
  8. proc dontcare(x: int): int = return global
  9. proc noSideEffect(x, y: int, p: proc (a: int): int {.noSideEffect.}): int {.noSideEffect.} =
  10. return x + y + dontcare(x)
  11. echo noSideEffect(1, 3, dontcare) #ERROR_MSG type mismatch