Don't inspect typedescs

This commit is contained in:
Flaviu Tamas 2015-05-26 18:29:44 -04:00
commit c9616897f0
2 changed files with 12 additions and 6 deletions

View file

@ -157,12 +157,13 @@ macro check*(conditions: stmt): stmt {.immediate.} =
# Ident !"v" # Ident !"v"
# IntLit 2 # IntLit 2
paramAst = exp[i][1] paramAst = exp[i][1]
argsAsgns.add getAst(asgn(arg, paramAst)) if exp[i].typekind notin {ntyTypeDesc}:
argsPrintOuts.add getAst(print(argStr, arg)) argsAsgns.add getAst(asgn(arg, paramAst))
if exp[i].kind != nnkExprEqExpr: argsPrintOuts.add getAst(print(argStr, arg))
exp[i] = arg if exp[i].kind != nnkExprEqExpr:
else: exp[i] = arg
exp[i][1] = arg else:
exp[i][1] = arg
case checked.kind case checked.kind
of nnkCallKinds: of nnkCallKinds:

View file

@ -0,0 +1,5 @@
import unittest
import options
test "unittest typedescs":
check(none(int) == none(int))
check(none(int) != some(1))