Add arity typetrait
This commit is contained in:
parent
6a04757e6d
commit
73aba23a49
2 changed files with 6 additions and 0 deletions
|
|
@ -914,6 +914,10 @@ proc evalTypeTrait*(trait, operand: PNode, context: PSym): PNode =
|
|||
result = newStrNode(nkStrLit, typ.typeToString(preferName))
|
||||
result.typ = newType(tyString, context)
|
||||
result.info = trait.info
|
||||
of "arity":
|
||||
result = newIntNode(nkIntLit, typ.n.len-1)
|
||||
result.typ = newType(tyInt, context)
|
||||
result.info = trait.info
|
||||
else:
|
||||
internalAssert false
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue