From 27585ee6ecd0dd2f7673b800e921ec2b3850e608 Mon Sep 17 00:00:00 2001 From: Simon Krauter Date: Wed, 15 Oct 2014 00:20:08 +0200 Subject: [PATCH] Compare fileIndexes instead of file names --- compiler/importer.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/importer.nim b/compiler/importer.nim index 4a0d83c66..9e327c8f7 100644 --- a/compiler/importer.nim +++ b/compiler/importer.nim @@ -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)