summary refs log tree commit diff stats
path: root/compiler/importer.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-08-29 11:33:41 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-08-29 11:33:41 +0200
commit154db46db817fff315b1a0ef2da36511e382cfad (patch)
treebb729c758dd394a3ec246977809e2b1cc4258fc5 /compiler/importer.nim
parent7e3ebc1bccb689176cfadd485fe8777bc343a5e6 (diff)
downloadNim-154db46db817fff315b1a0ef2da36511e382cfad.tar.gz
fixes a regression that caused --import in a config file to break things
Diffstat (limited to 'compiler/importer.nim')
-rw-r--r--compiler/importer.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/importer.nim b/compiler/importer.nim
index 7e7130b85..87415733b 100644
--- a/compiler/importer.nim
+++ b/compiler/importer.nim
@@ -163,7 +163,10 @@ proc myImportModule(c: PContext, n: PNode): PSym =
   var f = checkModuleName(n)
   if f != InvalidFileIDX:
     result = importModuleAs(n, gImportModule(c.module, f))
-    if result.info.fileIndex == c.module.info.fileIndex:
+    # we cannot perform this check reliably because of
+    # test: modules/import_in_config)
+    if result.info.fileIndex == c.module.info.fileIndex and
+        result.info.fileIndex == n.info.fileIndex:
       localError(n.info, errGenerated, "A module cannot import itself")
     if sfDeprecated in result.flags:
       message(n.info, warnDeprecated, result.name.s)