introduce a pre-processing pass for the concept bodies

fixes #4982
fixes #3805

close #3414
This commit is contained in:
Zahary Karadjov 2017-06-05 05:20:13 +03:00 • committed by Andreas Rumpf
commit cd02561368
13 changed files with 138 additions and 60 deletions

View file

@ -110,7 +110,7 @@ proc uninstantiate(t: PType): PType =
else: t
proc evalTypeTrait(traitCall: PNode, operand: PType, context: PSym): PNode =
const skippedTypes = {tyTypeDesc}
const skippedTypes = {tyTypeDesc, tyAlias}
let trait = traitCall[0]
internalAssert trait.kind == nkSym
var operand = operand.skipTypes(skippedTypes)
@ -119,7 +119,7 @@ proc evalTypeTrait(traitCall: PNode, operand: PType, context: PSym): PNode =
traitCall.sons[2].typ.skipTypes({tyTypeDesc})
template typeWithSonsResult(kind, sons): PNode =
newTypeWithSons2(kind, context, sons).toNode(traitCall.info)
newTypeWithSons(context, kind, sons).toNode(traitCall.info)
case trait.sym.name.s
of "or", "|":