Skip to content

Commit

Permalink
fixes #12420 [backport] (#12456)
Browse files Browse the repository at this point in the history
(cherry picked from commit 832b0a0)
  • Loading branch information
Araq authored and narimiran committed Oct 21, 2019
1 parent f579d29 commit b914573
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
13 changes: 5 additions & 8 deletions compiler/packagehandling.nim
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,9 @@ proc demanglePackageName*(path: string): string =

proc withPackageName*(conf: ConfigRef; path: AbsoluteFile): AbsoluteFile =
let x = getPackageName(conf, path.string)
if x.len == 0:
result = path
let (p, file, ext) = path.splitFile
if x == "stdlib":
# Hot code reloading now relies on 'stdlib_system' names etc.
result = p / RelativeFile((x & '_' & file) & ext)
else:
let (p, file, ext) = path.splitFile
if x == "stdlib":
# Hot code reloading now relies on 'stdlib_system' names etc.
result = p / RelativeFile((x & '_' & file) & ext)
else:
result = p / RelativeFile(fakePackageName(conf, path))
result = p / RelativeFile(fakePackageName(conf, path))
2 changes: 2 additions & 0 deletions tests/modules/a/utils.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
proc burnMem*(a: int) =
discard
2 changes: 2 additions & 0 deletions tests/modules/b/utils.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# module b/utils.nim
let x* = 10
5 changes: 5 additions & 0 deletions tests/modules/tutils_ab.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import a/utils as autils, b/utils

# bug #12420

burnMem(x)

0 comments on commit b914573

Please sign in to comment.