Merge branch 'devel' of https://github.com/Araq/Nimrod into devel
This commit is contained in:
commit
59c6433580
2 changed files with 12 additions and 2 deletions
|
|
@ -159,6 +159,8 @@ 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 == n.info.fileIndex:
|
||||
localError(n.info, errGenerated, "A module cannot import itself")
|
||||
if sfDeprecated in result.flags:
|
||||
message(n.info, warnDeprecated, result.name.s)
|
||||
|
||||
|
|
|
|||
8
tests/modules/tselfimport.nim
Normal file
8
tests/modules/tselfimport.nim
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
discard """
|
||||
file: "tselfimport.nim"
|
||||
line: 6
|
||||
errormsg: "A module cannot import itself"
|
||||
"""
|
||||
import tselfimport #ERROR
|
||||
echo("Hello World")
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue