From 88e221bad60ce20087fe2f8a85d506be36a6e6ca Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 30 Dec 2024 23:38:34 -0800 Subject: Fix requirement candidate lookup to prefer decls in the same paraent as the inheritance decl. (#5965) --- source/slang/slang-syntax.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/slang/slang-syntax.cpp') 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(decl)) + return decl; + decl = decl->parentDecl; + } + return nullptr; +} + Decl* getParentFunc(Decl* decl) { while (decl) -- cgit v1.2.3