fix getTypeImpl for tyEnum (#5568)
* fixed getTypeImpl for tyEnum * fixed getType for enum and updated release notes about change
This commit is contained in:
parent
1d6018726e
commit
3bffb3ba35
2 changed files with 7 additions and 1 deletions
|
|
@ -214,7 +214,9 @@ proc mapTypeToAstX(t: PType; info: TLineInfo;
|
||||||
result = atomicType(t.sym)
|
result = atomicType(t.sym)
|
||||||
of tyEnum:
|
of tyEnum:
|
||||||
result = newNodeIT(nkEnumTy, if t.n.isNil: info else: t.n.info, t)
|
result = newNodeIT(nkEnumTy, if t.n.isNil: info else: t.n.info, t)
|
||||||
result.add copyTree(t.n)
|
result.add ast.emptyNode # pragma node, currently always empty for enum
|
||||||
|
for c in t.n.sons:
|
||||||
|
result.add copyTree(c)
|
||||||
of tyTuple:
|
of tyTuple:
|
||||||
if inst:
|
if inst:
|
||||||
result = newNodeX(nkTupleTy)
|
result = newNodeX(nkTupleTy)
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,10 @@ Changes affecting backwards compatibility
|
||||||
upfront every implementation needs to fullfill these contracts.
|
upfront every implementation needs to fullfill these contracts.
|
||||||
- ``system.getAst templateCall(x, y)`` now typechecks the ``templateCall``
|
- ``system.getAst templateCall(x, y)`` now typechecks the ``templateCall``
|
||||||
properly. You need to patch your code accordingly.
|
properly. You need to patch your code accordingly.
|
||||||
|
- ``macros.getType`` and ``macros.getTypeImpl`` for an enum will now return an
|
||||||
|
AST that is the same as what is used to define an enum. Previously the AST
|
||||||
|
returned had a repeated ``EnumTy`` node and was missing the initial pragma
|
||||||
|
node (which is currently empty for an enum).
|
||||||
|
|
||||||
|
|
||||||
Library Additions
|
Library Additions
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue