mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-20 14:25:23 +00:00
@@ -1,8 +1,12 @@
|
||||
discard """
|
||||
output: '''true
|
||||
output: '''
|
||||
true
|
||||
true
|
||||
true inner B'''
|
||||
true
|
||||
true inner B
|
||||
running with pragma
|
||||
ran with pragma
|
||||
'''
|
||||
"""
|
||||
|
||||
template withValue(a, b, c, d, e: untyped) =
|
||||
@@ -77,3 +81,14 @@ proc main2 =
|
||||
echo "true inner B"
|
||||
|
||||
main2()
|
||||
|
||||
proc withPragma(foo: int, bar: proc() {.raises: [].}) =
|
||||
echo "running with pragma"
|
||||
bar()
|
||||
|
||||
withPragma(3) do {.raises: [].}:
|
||||
echo "ran with pragma"
|
||||
|
||||
doAssert not (compiles do:
|
||||
withPragma(3) do {.raises: [].}:
|
||||
raise newException(Exception))
|
||||
|
||||
Reference in New Issue
Block a user