summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-reflection-api.cpp
diff options
context:
space:
mode:
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))