summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-serialize-container.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-02-12 14:58:00 -0800
committerGitHub <noreply@github.com>2025-02-12 14:58:00 -0800
commit74852ceb6b3bcc018042aba3e30933b7b6fc09ef (patch)
treeb77dd62f0e74510fae0d2af8b7afa260ce9d49b8 /source/slang/slang-serialize-container.cpp
parent3f102afe1038882f336dc052a9954811150fa700 (diff)
Allow LHS of `where` to be any type. (#6333)
* Allow LHS of `where` to be any type. * Register free-form extensions when loading precompiled module. * Fix test. * Fix. * Fix `as<IRType>`. * try fix precompiled module test.
Diffstat (limited to 'source/slang/slang-serialize-container.cpp')
-rw-r--r--source/slang/slang-serialize-container.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/slang/slang-serialize-container.cpp b/source/slang/slang-serialize-container.cpp
index e5775f526..b5121d373 100644
--- a/source/slang/slang-serialize-container.cpp
+++ b/source/slang/slang-serialize-container.cpp
@@ -5,6 +5,7 @@
#include "../core/slang-math.h"
#include "../core/slang-stream.h"
#include "../core/slang-text-io.h"
+#include "slang-check-impl.h"
#include "slang-compiler.h"
#include "slang-mangled-lexer.h"
#include "slang-parser.h"
@@ -813,15 +814,16 @@ static List<ExtensionDecl*>& _getCandidateExtensionList(
if (auto targetDeclRefType =
as<DeclRefType>(extensionDecl->targetType))
{
- // Attach our extension to that type as a candidate...
- if (auto aggTypeDeclRef =
- targetDeclRefType->getDeclRef()
- .as<AggTypeDecl>())
+ ShortList<AggTypeDecl*> baseDecls;
+ getExtensionTargetDeclList(
+ astBuilder,
+ targetDeclRefType,
+ extensionDecl,
+ baseDecls);
+ for (auto baseDecl : baseDecls)
{
- auto aggTypeDecl = aggTypeDeclRef.getDecl();
-
_getCandidateExtensionList(
- aggTypeDecl,
+ baseDecl,
moduleDecl->mapTypeToCandidateExtensions)
.add(extensionDecl);
}