summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-decl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-check-decl.cpp')
-rw-r--r--source/slang/slang-check-decl.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp
index 2a5b5a4e3..0319eb260 100644
--- a/source/slang/slang-check-decl.cpp
+++ b/source/slang/slang-check-decl.cpp
@@ -2897,14 +2897,13 @@ void SemanticsDeclBasesVisitor::visitInheritanceDecl(InheritanceDecl* inheritanc
{
// check the type being inherited from
auto base = inheritanceDecl->base;
- Decl* toExclude = nullptr;
Decl* parent = getParentDecl(inheritanceDecl);
- // We exclude in the case that a circular reference is possible. This is when a parent is a
- // transparent decl. If we just blanket "block" all ensure's of a parent a generic may fail when
- // trying to fetch a parent
+ // We exclude transparent members in the case that a circular reference is
+ // possible. This is when a parent is also a transparent decl.
+ SemanticsContext context(*this);
if (parent->findModifier<TransparentModifier>())
- toExclude = parent;
- SemanticsDeclVisitorBase baseVistor(this->withDeclToExcludeFromLookup(toExclude));
+ context = context.excludeTransparentMembersFromLookup();
+ SemanticsDeclVisitorBase baseVistor(context);
baseVistor.CheckConstraintSubType(base);
base = baseVistor.TranslateTypeNode(base);
inheritanceDecl->base = base;