fixes a regression that caused --import in a config file to break things
This commit is contained in:
parent
7e3ebc1bcc
commit
154db46db8
4 changed files with 6 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue