summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-inheritance.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-06-11 12:12:53 -0700
committerGitHub <noreply@github.com>2025-06-11 12:12:53 -0700
commit45560483447dd737a63efc236b2be07fd0fc4347 (patch)
treed0bc2e90d3aa0bfb630e02789ad6d38986cbc2a6 /source/slang/slang-check-inheritance.cpp
parent5a851fe846bb4b3657dfc94a88fcce7b1221a8eb (diff)
Fix an issue in extension override. (#7402)
* Fix an issue in extension override. * Fix typo in comment.
Diffstat (limited to 'source/slang/slang-check-inheritance.cpp')
-rw-r--r--source/slang/slang-check-inheritance.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/source/slang/slang-check-inheritance.cpp b/source/slang/slang-check-inheritance.cpp
index 37b4d3158..2554553de 100644
--- a/source/slang/slang-check-inheritance.cpp
+++ b/source/slang/slang-check-inheritance.cpp
@@ -450,14 +450,15 @@ InheritanceInfo SharedSemanticsContext::_calcInheritanceInfo(
// then we need to add the extension itself as a facet.
//
auto extDeclRef =
- createDefaultSubstitutionsIfNeeded(astBuilder, &visitor, extensionDecl);
- auto selfExtFacet = new (arena) Facet::Impl(
+ createDefaultSubstitutionsIfNeeded(astBuilder, &visitor, extensionDecl)
+ .as<ExtensionDecl>();
+ auto extInheritanceInfo = getInheritanceInfo(extDeclRef, circularityInfo);
+ addDirectBaseFacet(
Facet::Kind::Extension,
- Facet::Directness::Direct,
- extDeclRef,
selfType,
- astBuilder->getTypeEqualityWitness(selfType));
- allFacets.add(selfExtFacet);
+ selfIsSelf,
+ extDeclRef,
+ extInheritanceInfo);
}
}