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)
|
var f = checkModuleName(n)
|
||||||
if f != InvalidFileIDX:
|
if f != InvalidFileIDX:
|
||||||
result = importModuleAs(n, gImportModule(c.module, f))
|
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")
|
localError(n.info, errGenerated, "A module cannot import itself")
|
||||||
if sfDeprecated in result.flags:
|
if sfDeprecated in result.flags:
|
||||||
message(n.info, warnDeprecated, result.name.s)
|
message(n.info, warnDeprecated, result.name.s)
|
||||||
|
|
|
||||||
2
tests/import_in_config/nim.cfg
Normal file
2
tests/import_in_config/nim.cfg
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
import = "other"
|
||||||
|
path = "$projectDir"
|
||||||
0
tests/import_in_config/other.nim
Normal file
0
tests/import_in_config/other.nim
Normal file
0
tests/import_in_config/tmain.nim
Normal file
0
tests/import_in_config/tmain.nim
Normal file
Loading…
Add table
Add a link
Reference in a new issue