make parseEnum skip type aliases for enum type sym (#22727)

fixes #22726

(cherry picked from commit 51cb493b22)
This commit is contained in:
metagn
2023-09-19 10:14:55 +03:00
committed by narimiran
parent cc7f76a247
commit d56000eaff
2 changed files with 17 additions and 5 deletions

View File

@@ -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