diff options
author | Araq <rumpf_a@web.de> | 2014-10-22 01:54:27 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-10-22 01:54:27 +0200 |
commit | fa775473106c393d84f172888da9c23207c89624 (patch) | |
tree | 006523e95a7471a16332ce1714f8d8880184327d | |
parent | 95595d86a99ea44cbf1be1d2ce0e13ca5cdfb404 (diff) | |
download | Nim-fa775473106c393d84f172888da9c23207c89624.tar.gz |
fixes 'import x as y' regression
-rw-r--r-- | compiler/importer.nim | 2 | ||||
-rw-r--r-- | tests/modules/tselfimport.nim | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/compiler/importer.nim b/compiler/importer.nim index 9e327c8f7..58b5ef8d4 100644 --- a/compiler/importer.nim +++ b/compiler/importer.nim @@ -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) diff --git a/tests/modules/tselfimport.nim b/tests/modules/tselfimport.nim index f20a40407..ddb3a5b09 100644 --- a/tests/modules/tselfimport.nim +++ b/tests/modules/tselfimport.nim @@ -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") |