Remove immediate pragma (#11308)
* remove immediate from tests * remove immediate from the compiler
This commit is contained in:
parent
eb471acffb
commit
5b27b263fd
22 changed files with 53 additions and 116 deletions
|
|
@ -18,14 +18,19 @@ test "previous definitions can be further overloaded or hidden in local scopes":
|
|||
check t("test") == "string"
|
||||
|
||||
test "templates can be redefined multiple times":
|
||||
template customAssert(cond: bool, msg: string): typed {.immediate, dirty.} =
|
||||
template customAssert(cond: bool, msg: string): typed {.dirty.} =
|
||||
if not cond: fail(msg)
|
||||
|
||||
template assertion_failed(body: typed) {.immediate, dirty.} =
|
||||
template fail(msg: string): typed = body
|
||||
template assertionFailed(body: untyped) {.dirty.} =
|
||||
template fail(msg: string): typed =
|
||||
body
|
||||
|
||||
assertionFailed:
|
||||
check(msg == "first fail path")
|
||||
|
||||
assertion_failed: check msg == "first fail path"
|
||||
customAssert false, "first fail path"
|
||||
|
||||
assertion_failed: check msg == "second fail path"
|
||||
assertionFailed:
|
||||
check(msg == "second fail path")
|
||||
|
||||
customAssert false, "second fail path"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue