diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2020-10-06 16:47:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-06 16:47:15 +0200 |
commit | 92163fa3304e5b6768a50d36a5243639ce4a2f69 (patch) | |
tree | b7aa2705a4772e8f82d61e765ff9158f7b21b441 /tests/effects/tcast_as_pragma.nim | |
parent | acd71dd6bb745eb08f81ab489d635951f8edfcfa (diff) | |
download | Nim-92163fa3304e5b6768a50d36a5243639ce4a2f69.tar.gz |
implements https://github.com/nim-lang/RFCs/issues/258 (#15503)
* implements https://github.com/nim-lang/RFCs/issues/258 * don't be too strict with custom pragma blocks * cast pragmas: documentation * added most missing inference query procs to effecttraits.nim
Diffstat (limited to 'tests/effects/tcast_as_pragma.nim')
-rw-r--r-- | tests/effects/tcast_as_pragma.nim | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/effects/tcast_as_pragma.nim b/tests/effects/tcast_as_pragma.nim new file mode 100644 index 000000000..1de61333e --- /dev/null +++ b/tests/effects/tcast_as_pragma.nim @@ -0,0 +1,18 @@ +discard """ + cmd: "nim c $file" + action: "compile" +""" + +proc taggy() {.tags: RootEffect.} = discard + +proc m {.raises: [], tags: [].} = + {.cast(noSideEffect).}: + echo "hi" + + {.cast(raises: []).}: + raise newException(ValueError, "bah") + + {.cast(tags: []).}: + taggy() + +m() |