summary refs log tree commit diff stats
path: root/compiler/semexprs.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-07-18 18:16:25 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-07-18 18:16:25 +0200
commit9852cf804b09710837c849bdfda2be499e702a05 (patch)
tree6394c0dbbd3963ab6655a9432372ffbb51111b68 /compiler/semexprs.nim
parent4137a4dbf386f19b0ce4f5de5b0a8ab05a3b2b8b (diff)
downloadNim-9852cf804b09710837c849bdfda2be499e702a05.tar.gz
warn about unused imports; fixes an 'export' regression [nobackport]
Diffstat (limited to 'compiler/semexprs.nim')
-rw-r--r--compiler/semexprs.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index 00f4620af..733df2c40 100644
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -2450,7 +2450,7 @@ proc semExportExcept(c: PContext, n: PNode): PNode =
   var s = initTabIter(i, exported.tab)
   while s != nil:
     if s.kind in ExportableSymKinds+{skModule} and
-       s.name.id notin exceptSet:
+       s.name.id notin exceptSet and sfError notin s.flags:
       strTableAdd(c.module.tab, s)
       result.add newSymNode(s, n.info)
       markUsed(c, n.info, s, c.graph.usageSym)
@@ -2480,10 +2480,10 @@ proc semExport(c: PContext, n: PNode): PNode =
         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} and sfError notin s.flags:
           result.add(newSymNode(s, a.info))
           strTableAdd(c.module.tab, s)
-        markUsed(c, n.info, s, c.graph.usageSym)
+          markUsed(c, n.info, s, c.graph.usageSym)
         s = nextOverloadIter(o, c, a)
 
 proc semTupleConstr(c: PContext, n: PNode, flags: TExprFlags): PNode =