From 2e2c7943da89b0100db3bba4b11267b5a857ca92 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 20 Feb 2024 23:13:29 -0800 Subject: Language server robustness fix. (#3607) * Language server robustness fix. * Allow parameter name to be the same as its type. * fix * Fix test. --- source/slang/slang-check-decl.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/slang/slang-check-decl.cpp') diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp index 1c964ab88..28db66c45 100644 --- a/source/slang/slang-check-decl.cpp +++ b/source/slang/slang-check-decl.cpp @@ -7665,11 +7665,16 @@ namespace Slang { // Create a new sub-scope to wire the module // into our lookup chain. + if (!fileDecl) + return; addSiblingScopeForContainerDecl(getASTBuilder(), scope, fileDecl); } void SemanticsVisitor::importModuleIntoScope(Scope* scope, ModuleDecl* moduleDecl) { + if (!moduleDecl) + return; + // If we've imported this one already, then // skip the step where we modify the current scope. auto& importedModulesList = getShared()->importedModulesList; -- cgit v1.2.3