summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-decl.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-decl.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-decl.cpp')
-rw-r--r--source/slang/slang-check-decl.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp
index b56c3cb07..2865188b4 100644
--- a/source/slang/slang-check-decl.cpp
+++ b/source/slang/slang-check-decl.cpp
@@ -7545,7 +7545,9 @@ void SemanticsVisitor::checkExtensionConformance(ExtensionDecl* decl)
.as<ExtensionDecl>();
auto targetType = getTargetType(m_astBuilder, declRef);
- for (auto inheritanceDecl : decl->getMembersOfType<InheritanceDecl>())
+ // Make a copy of inhertanceDecls first since `checkConformance` may modify decl->members.
+ auto inheritanceDecls = decl->getMembersOfType<InheritanceDecl>().toList();
+ for (auto inheritanceDecl : inheritanceDecls)
{
checkConformance(targetType, inheritanceDecl, decl);
}
@@ -7596,7 +7598,7 @@ void SemanticsVisitor::checkAggTypeConformance(AggTypeDecl* decl)
// just with `abstract` methods that replicate things?
// (That's what C# does).
- // Make a copy of inhertanceDecls firstsince `checkConformance` may modify decl->members.
+ // Make a copy of inhertanceDecls first since `checkConformance` may modify decl->members.
auto inheritanceDecls = decl->getMembersOfType<InheritanceDecl>().toList();
for (auto inheritanceDecl : inheritanceDecls)
{