Small scope refactoring (#18263)
* Small scope refactoring * Add test for #10251 * Add inline where appropriate
This commit is contained in:
parent
0adb47aa15
commit
8c42f5be02
4 changed files with 33 additions and 24 deletions
|
|
@ -138,15 +138,13 @@ proc semEnum(c: PContext, n: PNode, prev: PType): PType =
|
|||
identToReplace[] = symNode
|
||||
if e.position == 0: hasNull = true
|
||||
if result.sym != nil and sfExported in result.sym.flags:
|
||||
incl(e.flags, {sfUsed, sfExported})
|
||||
if result.sym != nil and not isPure:
|
||||
addInterfaceDeclAux(c, e, forceExport = sfExported in result.sym.flags)
|
||||
e.flags.incl {sfUsed, sfExported}
|
||||
|
||||
result.n.add symNode
|
||||
styleCheckDef(c.config, e)
|
||||
onDef(e.info, e)
|
||||
if sfGenSym notin e.flags:
|
||||
if not isPure: addDecl(c, e)
|
||||
if not isPure: addInterfaceDecl(c, e)
|
||||
else: declarePureEnumField(c, e)
|
||||
if isPure and (let conflict = strTableInclReportConflict(symbols, e); conflict != nil):
|
||||
wrongRedefinition(c, e.info, e.name.s, conflict.info)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue