mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-18 23:11:36 +00:00
progress towards adding negative type classes
[unittest bugfixes] the block form of check now allows comments errors when inspecting the arguments of var-accepting procs
This commit is contained in:
@@ -115,7 +115,8 @@ macro check*(conditions: stmt): stmt {.immediate.} =
|
||||
counter = 0
|
||||
|
||||
template asgn(a, value: expr): stmt =
|
||||
let a = value
|
||||
var a = value # XXX: we need "var: var" here in order to
|
||||
# preserve the semantics of var params
|
||||
|
||||
template print(name, value: expr): stmt =
|
||||
when compiles(string($value)):
|
||||
@@ -150,7 +151,8 @@ macro check*(conditions: stmt): stmt {.immediate.} =
|
||||
of nnkStmtList:
|
||||
result = newNimNode(nnkStmtList)
|
||||
for i in countup(0, checked.len - 1):
|
||||
result.add(newCall(!"check", checked[i]))
|
||||
if checked[i].kind != nnkCommentStmt:
|
||||
result.add(newCall(!"check", checked[i]))
|
||||
|
||||
else:
|
||||
template rewrite(Exp, lineInfoLit: expr, expLit: string): stmt =
|
||||
|
||||
Reference in New Issue
Block a user