overloading resolution for getAst; breaking change
This commit is contained in:
parent
242fb3240f
commit
aa4260ffa8
5 changed files with 44 additions and 18 deletions
|
|
@ -758,10 +758,11 @@ macro `=~`(x: PNode, pat: untyped): bool =
|
|||
of nnkIdent:
|
||||
let c = newTree(nnkStmtListExpr, newLetStmt(pat, x))
|
||||
conds.add c
|
||||
if ($pat)[^1] == 'c': c.add(getAst(isVal(pat)))
|
||||
# XXX why is this 'isVal(pat)' and not 'isVal(x)'?
|
||||
if ($pat)[^1] == 'c': c.add(getAst(isVal(x)))
|
||||
else: c.add bindSym"true"
|
||||
of nnkIntLit:
|
||||
conds.add(getAst(isIntVal(pat.intVal)))
|
||||
conds.add(getAst(isIntVal(x, pat.intVal)))
|
||||
else:
|
||||
error("invalid pattern")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue