Skip to content

Commit

Permalink
maybe a bug with the previous code?
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn committed Dec 23, 2023
1 parent a0a6bb4 commit cdf3239
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 2 additions & 4 deletions compiler/semexprs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3043,10 +3043,6 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}, expectedType: PType
s = f.sym
break
if s == nil:
let checks = if efNoEvaluateGeneric in flags:
{checkUndeclared, checkPureEnumFields}
else:
{checkUndeclared, checkModule, checkPureEnumFields}
let candidates = lookUpCandidates(c, ident)
if candidates.len == 0:
s = errorUndeclaredIdentifierHint(c, n, ident)
Expand All @@ -3065,6 +3061,8 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}, expectedType: PType
resolveSymChoice(c, choice, flags, expectedType)
if choice.kind == nkSym:
s = choice.sym
elif efAllowSymChoice in flags:
result = choice
else:
errorUseQualifier(c, n.info, candidates)
if s == nil:
Expand Down
1 change: 1 addition & 0 deletions tests/enum/tpure_enums_conflict.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
discard """
disabled: true
errormsg: "ambiguous identifier: 'amb'"
line: 19
"""
Expand Down

0 comments on commit cdf3239

Please sign in to comment.