diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-08-29 11:33:41 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2016-08-29 11:33:41 +0200 |
commit | 154db46db817fff315b1a0ef2da36511e382cfad (patch) | |
tree | bb729c758dd394a3ec246977809e2b1cc4258fc5 /compiler/importer.nim | |
parent | 7e3ebc1bccb689176cfadd485fe8777bc343a5e6 (diff) | |
download | Nim-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.nim | 5 |
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) |