summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/vmdeps.nim4
-rw-r--r--web/news/e031_version_0_16_2.rst4
2 files changed, 7 insertions, 1 deletions
diff --git a/compiler/vmdeps.nim b/compiler/vmdeps.nim
index 779d6d2a4..d684c4c32 100644
--- a/compiler/vmdeps.nim
+++ b/compiler/vmdeps.nim
@@ -214,7 +214,9 @@ proc mapTypeToAstX(t: PType; info: TLineInfo;
         result = atomicType(t.sym)
   of tyEnum:
     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:
     if inst:
       result = newNodeX(nkTupleTy)
diff --git a/web/news/e031_version_0_16_2.rst b/web/news/e031_version_0_16_2.rst
index a4202833f..35f3716a3 100644
--- a/web/news/e031_version_0_16_2.rst
+++ b/web/news/e031_version_0_16_2.rst
@@ -38,6 +38,10 @@ Changes affecting backwards compatibility
   upfront every implementation needs to fullfill these contracts.
 - ``system.getAst templateCall(x, y)`` now typechecks the ``templateCall``
   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