From 550405d2de2ca617046e73fe5ec7e5e1765a5c97 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 3 Jan 2018 17:15:03 -0800 Subject: Fix type lookup of global type arguments Global type argument lookup should be done in both loaded modules and current trnaslation units. This is the same as the logic of spReflection_FindTypeByName, so it is extracted into `CompileRequest::lookupGlobalDecl(Name*)` method and reused in places. --- source/slang/check.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/slang/check.cpp') diff --git a/source/slang/check.cpp b/source/slang/check.cpp index dc5efbd73..46ed9da15 100644 --- a/source/slang/check.cpp +++ b/source/slang/check.cpp @@ -6777,7 +6777,8 @@ namespace Slang // Lookup generic parameter types in global scope for (auto name : entryPoint->genericParameterTypeNames) { - if (!translationUnitSyntax->memberDictionary.TryGetValue(name, firstDeclWithName)) + firstDeclWithName = entryPoint->compileRequest->lookupGlobalDecl(name); + if (!firstDeclWithName) { // If there doesn't appear to be any such declaration, then // we need to diagnose it as an error, and then bail out. -- cgit v1.2.3