From 832b0a0232e610c1935aaf6ce0b45f69199f8a19 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Fri, 18 Oct 2019 22:13:24 +0200 Subject: fixes #12420 [backport] (#12456) --- compiler/packagehandling.nim | 13 +++++-------- tests/modules/a/utils.nim | 2 ++ tests/modules/b/utils.nim | 2 ++ tests/modules/tutils_ab.nim | 5 +++++ 4 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 tests/modules/a/utils.nim create mode 100644 tests/modules/b/utils.nim create mode 100644 tests/modules/tutils_ab.nim diff --git a/compiler/packagehandling.nim b/compiler/packagehandling.nim index 7fb560433..ee6af0615 100644 --- a/compiler/packagehandling.nim +++ b/compiler/packagehandling.nim @@ -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)) diff --git a/tests/modules/a/utils.nim b/tests/modules/a/utils.nim new file mode 100644 index 000000000..f37abfb93 --- /dev/null +++ b/tests/modules/a/utils.nim @@ -0,0 +1,2 @@ +proc burnMem*(a: int) = + discard diff --git a/tests/modules/b/utils.nim b/tests/modules/b/utils.nim new file mode 100644 index 000000000..e343385f5 --- /dev/null +++ b/tests/modules/b/utils.nim @@ -0,0 +1,2 @@ +# module b/utils.nim +let x* = 10 diff --git a/tests/modules/tutils_ab.nim b/tests/modules/tutils_ab.nim new file mode 100644 index 000000000..25bd08f3c --- /dev/null +++ b/tests/modules/tutils_ab.nim @@ -0,0 +1,5 @@ +import a/utils as autils, b/utils + +# bug #12420 + +burnMem(x) -- cgit 1.4.1-2-gfad0 >
path: root/doc/rifle.1
blob: 0b67edcc599fa689efaee843dbf268011d1907d4 (plain) (tree)
1