From 652a3c987d2b42d069bf54ba251126208d00d9e7 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Thu, 1 Feb 2018 14:41:34 -0800 Subject: Fix a bug in import handling (#394) The recent change that removed `#import` accidentally introduced a regression that made *any* code that imports the same module in more than one place fail. I'm just fixing the bug for now to unblock users, but this should really get a regression test. --- source/slang/slang.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source') diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index 688593529..0ba3e790c 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -575,7 +575,10 @@ RefPtr CompileRequest::findOrImportModule( { // We seem to be in the middle of loading this module mSink.diagnose(loc, Diagnostics::recursiveModuleImport, name); + return nullptr; } + + return loadedModule->moduleDecl; } // Derive a file name for the module, by taking the given -- cgit v1.2.3