mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-06 13:07:48 +00:00
Show error when trying to export individual enum field (#10109)
This commit is contained in:
committed by
Arne Döring
parent
044cef152f
commit
387831d657
@@ -2335,7 +2335,6 @@ proc semExportExcept(c: PContext, n: PNode): PNode =
|
||||
|
||||
proc semExport(c: PContext, n: PNode): PNode =
|
||||
result = newNodeI(nkExportStmt, n.info)
|
||||
|
||||
for i in 0..<n.len:
|
||||
let a = n.sons[i]
|
||||
var o: TOverloadIter
|
||||
@@ -2354,6 +2353,9 @@ proc semExport(c: PContext, n: PNode): PNode =
|
||||
it = nextIter(ti, s.tab)
|
||||
else:
|
||||
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}:
|
||||
result.add(newSymNode(s, a.info))
|
||||
strTableAdd(c.module.tab, s)
|
||||
|
||||
Reference in New Issue
Block a user