summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-reflection-api.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-02-13 03:29:36 -0800
committerGitHub <noreply@github.com>2025-02-13 19:29:36 +0800
commitccc75cdd9508a4e19efa22e7c911cc2013f514fa (patch)
tree6cc198fcb0d5a58b58f56705ef134bbd5f584587 /source/slang/slang-reflection-api.cpp
parent8406b5647a61fb70be4e041a76c1b64b05a70452 (diff)
Reflection Fixes. (#6346)
* Fix 6317. * Fixes #6316. * Fix cmake preset. --------- Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
Diffstat (limited to 'source/slang/slang-reflection-api.cpp')
-rw-r--r--source/slang/slang-reflection-api.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/slang/slang-reflection-api.cpp b/source/slang/slang-reflection-api.cpp
index d1adfedc0..52047a751 100644
--- a/source/slang/slang-reflection-api.cpp
+++ b/source/slang/slang-reflection-api.cpp
@@ -1016,9 +1016,10 @@ SLANG_API SlangReflectionType* spReflection_FindTypeByName(
SubstitutionSet(genericDeclRef),
astBuilder,
genericDeclRef.getDecl()->inner);
- return convert(DeclRefType::create(
- astBuilder,
- createDefaultSubstitutionsIfNeeded(astBuilder, nullptr, innerDeclRef)));
+ if (as<AggTypeDecl>(innerDeclRef.getDecl()) ||
+ as<SimpleTypeDecl>(innerDeclRef.getDecl()))
+ return convert(DeclRefType::create(astBuilder, innerDeclRef));
+ return nullptr;
}
if (as<ErrorType>(result))