summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authormetagn <metagngn@gmail.com>2023-09-19 10:14:55 +0300
committerGitHub <noreply@github.com>2023-09-19 09:14:55 +0200
commit51cb493b221e704efce126049f9f320eb1cb1a36 (patch)
tree674f43248692a3c9269e5e93161fc49dc8130bae /lib
parentb542be1e7de067573370a3159b0812396309ef8b (diff)
downloadNim-51cb493b221e704efce126049f9f320eb1cb1a36.tar.gz
make parseEnum skip type aliases for enum type sym (#22727)
fixes #22726
Diffstat (limited to 'lib')
-rw-r--r--lib/std/enumutils.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/std/enumutils.nim b/lib/std/enumutils.nim
index 0386c2589..1ce82eccf 100644
--- a/lib/std/enumutils.nim
+++ b/lib/std/enumutils.nim
@@ -22,7 +22,8 @@ macro genEnumCaseStmt*(typ: typedesc, argSym: typed, default: typed,
   # a normalized string comparison to the `argSym` input.
   # string normalization is done using passed normalizer.
   let typ = typ.getTypeInst[1]
-  let impl = typ.getImpl[2]
+  let typSym = typ.getTypeImpl.getTypeInst # skip aliases etc to get type sym
+  let impl = typSym.getImpl[2]
   expectKind impl, nnkEnumTy
   let normalizerNode = quote: `normalizer`
   expectKind normalizerNode, nnkSym