Show error when trying to export individual enum field (#10109)
This commit is contained in:
parent
044cef152f
commit
387831d657
1 changed files with 3 additions and 1 deletions
|
|
@ -2335,7 +2335,6 @@ proc semExportExcept(c: PContext, n: PNode): PNode =
|
||||||
|
|
||||||
proc semExport(c: PContext, n: PNode): PNode =
|
proc semExport(c: PContext, n: PNode): PNode =
|
||||||
result = newNodeI(nkExportStmt, n.info)
|
result = newNodeI(nkExportStmt, n.info)
|
||||||
|
|
||||||
for i in 0..<n.len:
|
for i in 0..<n.len:
|
||||||
let a = n.sons[i]
|
let a = n.sons[i]
|
||||||
var o: TOverloadIter
|
var o: TOverloadIter
|
||||||
|
|
@ -2354,6 +2353,9 @@ proc semExport(c: PContext, n: PNode): PNode =
|
||||||
it = nextIter(ti, s.tab)
|
it = nextIter(ti, s.tab)
|
||||||
else:
|
else:
|
||||||
while s != nil:
|
while s != nil:
|
||||||
|
if s.kind == skEnumField:
|
||||||
|
localError(c.config, a.info, errGenerated, "cannot export: " & renderTree(a) &
|
||||||
|
"; enum field cannot be exported individually")
|
||||||
if s.kind in ExportableSymKinds+{skModule}:
|
if s.kind in ExportableSymKinds+{skModule}:
|
||||||
result.add(newSymNode(s, a.info))
|
result.add(newSymNode(s, a.info))
|
||||||
strTableAdd(c.module.tab, s)
|
strTableAdd(c.module.tab, s)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue