summaryrefslogtreecommitdiff
path: root/source/slang/slang-lower-to-ir.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-lower-to-ir.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-lower-to-ir.cpp')
-rw-r--r--source/slang/slang-lower-to-ir.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp
index 06cdf430b..ed8a52b9e 100644
--- a/source/slang/slang-lower-to-ir.cpp
+++ b/source/slang/slang-lower-to-ir.cpp
@@ -9453,10 +9453,10 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo>
// should handle propgation of value-size information from constraints
// back to generic parameters?
//
- if (auto declRefType = as<DeclRefType>(constraintDecl->sub.type))
+ if (auto genParamDeclRef =
+ isDeclRefTypeOf<GenericTypeParamDeclBase>(constraintDecl->sub.type))
{
- auto typeParamDeclVal =
- subContext->findLoweredDecl(declRefType->getDeclRef().getDecl());
+ auto typeParamDeclVal = subContext->findLoweredDecl(genParamDeclRef.getDecl());
SLANG_ASSERT(typeParamDeclVal && typeParamDeclVal->val);
subBuilder->addTypeConstraintDecoration(typeParamDeclVal->val, supType);
}