mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 05:50:30 +00:00
fixes 'import x as y' regression
This commit is contained in:
@@ -153,7 +153,7 @@ proc importModuleAs(n: PNode, realModule: PSym): PSym =
|
||||
localError(n.info, errGenerated, "module alias must be an identifier")
|
||||
elif n.sons[1].ident.id != realModule.name.id:
|
||||
# some misguided guy will write 'import abc.foo as foo' ...
|
||||
result = createModuleAlias(realModule, n.sons[1].ident, n.sons[1].info)
|
||||
result = createModuleAlias(realModule, n.sons[1].ident, realModule.info)
|
||||
|
||||
proc myImportModule(c: PContext, n: PNode): PSym =
|
||||
var f = checkModuleName(n)
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
discard """
|
||||
file: "tselfimport.nim"
|
||||
line: 6
|
||||
line: 7
|
||||
errormsg: "A module cannot import itself"
|
||||
"""
|
||||
import strutils as su # guard against regression
|
||||
import tselfimport #ERROR
|
||||
echo("Hello World")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user