mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
fixes a regression that caused --import in a config file to break things
This commit is contained in:
@@ -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)
|
||||
|
||||
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
Reference in New Issue
Block a user