summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-syntax.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-12-30 23:38:34 -0800
committerGitHub <noreply@github.com>2024-12-30 23:38:34 -0800
commit88e221bad60ce20087fe2f8a85d506be36a6e6ca (patch)
tree1a3c546d8a242c96dfe0fb0056ac891bd8394942 /source/slang/slang-syntax.cpp
parent89dd2b1278f9e457d9d343742a51de27502ebca1 (diff)
Fix requirement candidate lookup to prefer decls in the same paraent as the inheritance decl. (#5965)
Diffstat (limited to 'source/slang/slang-syntax.cpp')
-rw-r--r--source/slang/slang-syntax.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/slang/slang-syntax.cpp b/source/slang/slang-syntax.cpp
index 1d3763299..5dc6ca695 100644
--- a/source/slang/slang-syntax.cpp
+++ b/source/slang/slang-syntax.cpp
@@ -1051,6 +1051,18 @@ Decl* getParentAggTypeDecl(Decl* decl)
return nullptr;
}
+Decl* getParentAggTypeDeclBase(Decl* decl)
+{
+ decl = decl->parentDecl;
+ while (decl)
+ {
+ if (as<AggTypeDeclBase>(decl))
+ return decl;
+ decl = decl->parentDecl;
+ }
+ return nullptr;
+}
+
Decl* getParentFunc(Decl* decl)
{
while (decl)