improve the error message for 'attempt to redefine X'; fixes #447
This commit is contained in:
parent
3467c455c0
commit
539fc5d58b
4 changed files with 29 additions and 18 deletions
|
|
@ -125,8 +125,8 @@ proc semEnum(c: PContext, n: PNode, prev: PType): PType =
|
|||
if sfGenSym notin e.flags:
|
||||
if not isPure: addDecl(c, e)
|
||||
else: importPureEnumField(c, e)
|
||||
if isPure and strTableIncl(symbols, e):
|
||||
wrongRedefinition(c, e.info, e.name.s)
|
||||
if isPure and (let conflict = strTableInclReportConflict(symbols, e); conflict != nil):
|
||||
wrongRedefinition(c, e.info, e.name.s, conflict.info)
|
||||
inc(counter)
|
||||
if not hasNull: incl(result.flags, tfNeedsInit)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue