fixes #21863; Incorrect enum field access can cause internal error (#21886)

fixes 21863; Incorrect enum field access can cause internal error
This commit is contained in:
ringabout
2023-05-24 13:43:30 +08:00
committed by GitHub
parent 9493e67291
commit 761b927e47
2 changed files with 29 additions and 1 deletions

View File

@@ -1047,7 +1047,7 @@ proc semIndirectOp(c: PContext, n: PNode, flags: TExprFlags; expectedType: PType
if s != nil:
setGenericParams(c, n[0])
return semDirectOp(c, n, flags, expectedType)
elif isSymChoice(n[0]):
elif isSymChoice(n[0]) and nfDotField notin n.flags:
# overloaded generic procs e.g. newSeq[int] can end up here
return semDirectOp(c, n, flags, expectedType)