Compare fileIndexes instead of file names
This commit is contained in:
parent
849484f920
commit
27585ee6ec
1 changed files with 1 additions and 1 deletions
|
|
@ -159,7 +159,7 @@ proc myImportModule(c: PContext, n: PNode): PSym =
|
|||
var f = checkModuleName(n)
|
||||
if f != InvalidFileIDX:
|
||||
result = importModuleAs(n, gImportModule(c.module, f))
|
||||
if result.name.s == fileInfos[n.info.fileIndex].shortName:
|
||||
if 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