mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-11 22:08:54 +00:00
* fix #18986; Import/except doesn't work on devel [backport: 1.6] * add testcase
This commit is contained in:
@@ -202,7 +202,7 @@ template addUnnamedIt(c: PContext, fromMod: PSym; filter: untyped) {.dirty.} =
|
||||
|
||||
proc importAllSymbolsExcept(c: PContext, fromMod: PSym, exceptSet: IntSet) =
|
||||
c.addImport ImportedModule(m: fromMod, mode: importExcept, exceptSet: exceptSet)
|
||||
addUnnamedIt(c, fromMod, it.sym.id notin exceptSet)
|
||||
addUnnamedIt(c, fromMod, it.sym.name.id notin exceptSet)
|
||||
|
||||
proc importAllSymbols*(c: PContext, fromMod: PSym) =
|
||||
c.addImport ImportedModule(m: fromMod, mode: importAll)
|
||||
|
||||
3
tests/converter/m18986.nim
Normal file
3
tests/converter/m18986.nim
Normal file
@@ -0,0 +1,3 @@
|
||||
import std/macros
|
||||
|
||||
converter Lit*(x: uint): NimNode = newLit(x)
|
||||
10
tests/converter/t18986.nim
Normal file
10
tests/converter/t18986.nim
Normal file
@@ -0,0 +1,10 @@
|
||||
discard """
|
||||
output: "Found a 0"
|
||||
"""
|
||||
|
||||
import m18986 except Lit
|
||||
import std/macros
|
||||
|
||||
# bug #18986
|
||||
var x = 0.uint
|
||||
echo "Found a ", x
|
||||
Reference in New Issue
Block a user