From 771da268461e9ad3addf94a452a4c13ee291918e Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 3 Jan 2018 12:53:16 -0800 Subject: spReflection_FindTypeByName: add lookup in translationUnits. --- source/slang/reflection.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/slang/reflection.cpp b/source/slang/reflection.cpp index 0558ff773..59b50891c 100644 --- a/source/slang/reflection.cpp +++ b/source/slang/reflection.cpp @@ -438,12 +438,17 @@ SLANG_API SlangReflectionType * spReflection_FindTypeByName(SlangReflection * re return (SlangReflectionType*)result.Ptr(); Decl* resultDecl = nullptr; + auto nameObj = compileRequest->getNamePool()->getName(name); for (auto module : compileRequest->loadedModulesList) { - auto nameObj = compileRequest->getNamePool()->getName(name); if (module->moduleDecl->memberDictionary.TryGetValue(nameObj, resultDecl)) break; } + for (auto transUnit : compileRequest->translationUnits) + { + if (transUnit->SyntaxNode->memberDictionary.TryGetValue(nameObj, resultDecl)) + break; + } if (resultDecl) { RefPtr declRefType = new DeclRefType(); -- cgit v1.2.3