diff --git a/compiler/ast2nif.nim b/compiler/ast2nif.nim index e5e3d2678c..6d8aea4ae8 100644 --- a/compiler/ast2nif.nim +++ b/compiler/ast2nif.nim @@ -453,6 +453,9 @@ proc trInclude(w: var Writer; n: PNode) = w.deps.addStrLit child.strVal # raw string literal, no wrapper needed w.deps.addParRi +proc moduleSuffix(conf: ConfigRef; f: FileIndex): string = + cachedModuleSuffix(conf, f) + proc trImport(w: var Writer; n: PNode) = for child in n: if child.kind == nkSym: @@ -461,7 +464,7 @@ proc trImport(w: var Writer; n: PNode) = w.deps.addDotToken # type let s = child.sym assert s.kindImpl == skModule - let fp = toFullPath(w.infos.config, s.positionImpl.FileIndex) + let fp = moduleSuffix(w.infos.config, s.positionImpl.FileIndex) w.deps.addStrLit fp # raw string literal, no wrapper needed w.deps.addParRi @@ -1311,9 +1314,6 @@ proc loadNode(c: var DecodeContext; n: var Cursor; thisModule: string; else: raiseAssert "expected string literal but got " & $n.kind -proc moduleSuffix(conf: ConfigRef; f: FileIndex): string = - cachedModuleSuffix(conf, f) - proc loadSymFromIndexEntry(c: var DecodeContext; module: FileIndex; nifName: string; entry: NifIndexEntry; thisModule: string): PSym = ## Loads a symbol from the NIF index entry using the entry directly.