From 675b6f07737a0f23b3b052552eeec525136c6960 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Fri, 14 Dec 2018 17:13:41 +0100 Subject: [PATCH] fixes #9978 --- compiler/passes.nim | 2 +- tests/modules/timport_in_config.nim | 8 ++++++++ tests/modules/timport_in_config.nim.cfg | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 tests/modules/timport_in_config.nim create mode 100644 tests/modules/timport_in_config.nim.cfg diff --git a/compiler/passes.nim b/compiler/passes.nim index 9ccd2240a..6863576cd 100644 --- a/compiler/passes.nim +++ b/compiler/passes.nim @@ -155,7 +155,7 @@ proc processModule*(graph: ModuleGraph; module: PSym, stream: PLLStream): bool { while true: openParsers(p, fileIdx, s, graph.cache, graph.config) - if sfSystemModule notin module.flags: + if graph.config.mainPackageId == module.owner.id: # XXX what about caching? no processing then? what if I change the # modules to include between compilation runs? we'd need to track that # in ROD files. I think we should enable this feature only diff --git a/tests/modules/timport_in_config.nim b/tests/modules/timport_in_config.nim new file mode 100644 index 000000000..1ea02407d --- /dev/null +++ b/tests/modules/timport_in_config.nim @@ -0,0 +1,8 @@ +discard """ +output: '''hallo''' +joinable: false +""" + +# bug #9978 + +echo "hi".replace("i", "allo") diff --git a/tests/modules/timport_in_config.nim.cfg b/tests/modules/timport_in_config.nim.cfg new file mode 100644 index 000000000..50b6679f8 --- /dev/null +++ b/tests/modules/timport_in_config.nim.cfg @@ -0,0 +1 @@ +--import: "strutils"