disallow recursive module dependencies

This commit is contained in:
Araq 2016-11-23 23:23:31 +01:00
commit 074f276c8a
14 changed files with 47 additions and 45 deletions

View file

@ -231,6 +231,7 @@ proc compileProject*(graph: ModuleGraph; cache: IdentCache;
wantMainModule()
let systemFileIdx = fileInfoIdx(options.libpath / "system.nim")
let projectFile = if projectFileIdx < 0: gProjectMainIdx else: projectFileIdx
graph.importStack.add projectFile
if projectFile == systemFileIdx:
discard graph.compileModule(projectFile, cache, {sfMainModule, sfSystemModule})
else: