tcast_as_pragma.nim 284 B

12345678910111213141516171819
  1. discard """
  2. cmd: "nim c $file"
  3. action: "compile"
  4. """
  5. proc taggy() {.tags: RootEffect.} = discard
  6. proc m {.raises: [], tags: [].} =
  7. {.cast(noSideEffect).}:
  8. echo "hi"
  9. {.cast(raises: []).}:
  10. raise newException(ValueError, "bah")
  11. {.cast(tags: []).}:
  12. taggy()
  13. m()