Skip to content

Commit

Permalink
fixup after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Nov 12, 2020
1 parent 4b6c9f6 commit c27e3e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/importer.nim
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ proc importModuleAs(c: PContext; n: PNode, realModule: PSym, importFlags: Import
c.config.options)
if ifPrivateImport in importFlags:
if result == realModule:
result = createModuleAlias(realModule, realModule.name, realModule.info,
result = createModuleAlias(realModule, nextId c.idgen, realModule.name, realModule.info,
c.config.options)
result.options.incl optPrivateImport
c.friendModulesPrivateImport.add realModule # `realModule` needed, not `result`
Expand All @@ -167,7 +167,7 @@ proc transformImportAs(c: PContext; n: PNode): tuple[node: PNode, importFlags: I
if n2.kind == nkPragmaExpr:
if n2.len == 2 and n2[1].kind == nkPragma and n2[1].len == 1 and n2[1][0].kind == nkIdent and whichKeyword(n2[1][0].ident) == wPrivateImport: discard
else:
globalError(c.config, n.info, "invalid import pragma, expected: " & wPrivateImport.canonPragmaSpelling)
globalError(c.config, n.info, "invalid import pragma, expected: " & $wPrivateImport)
if allowPrivateImport notin c.features:
globalError(c.config, n.info, "requires --experimental:" & $allowPrivateImport)
ret.importFlags.incl ifPrivateImport
Expand Down

0 comments on commit c27e3e0

Please sign in to comment.