summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-decl.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-02-20 23:13:29 -0800
committerGitHub <noreply@github.com>2024-02-20 23:13:29 -0800
commit2e2c7943da89b0100db3bba4b11267b5a857ca92 (patch)
tree8cbf8010e964cdbb7381fa15b1062b2c43cbd870 /source/slang/slang-check-decl.cpp
parent2ee05c1257c916e5c804a6b565a2a6aa362050e0 (diff)
Language server robustness fix. (#3607)
* Language server robustness fix. * Allow parameter name to be the same as its type. * fix * Fix test.
Diffstat (limited to 'source/slang/slang-check-decl.cpp')
-rw-r--r--source/slang/slang-check-decl.cpp5
1 files changed, 5 insertions, 0 deletions
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;