From 74852ceb6b3bcc018042aba3e30933b7b6fc09ef Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 12 Feb 2025 14:58:00 -0800 Subject: 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`. * try fix precompiled module test. --- source/slang/slang-serialize-container.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'source/slang/slang-serialize-container.cpp') 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& _getCandidateExtensionList( if (auto targetDeclRefType = as(extensionDecl->targetType)) { - // Attach our extension to that type as a candidate... - if (auto aggTypeDeclRef = - targetDeclRefType->getDeclRef() - .as()) + ShortList baseDecls; + getExtensionTargetDeclList( + astBuilder, + targetDeclRefType, + extensionDecl, + baseDecls); + for (auto baseDecl : baseDecls) { - auto aggTypeDecl = aggTypeDeclRef.getDecl(); - _getCandidateExtensionList( - aggTypeDecl, + baseDecl, moduleDecl->mapTypeToCandidateExtensions) .add(extensionDecl); } -- cgit v1.2.3