summaryrefslogtreecommitdiff
path: root/source/slang/check.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2018-01-20 02:48:12 -0500
committerYong He <yonghe@outlook.com>2018-01-20 02:48:12 -0500
commit913f4d09b91e3fd7449468b135881c940cacb3c0 (patch)
tree955ea56acc362f3b4ae071b93bbccfffc9799d3d /source/slang/check.cpp
parent6dd64fd9d31f29b07fcf63e743066efabbc1b092 (diff)
bug fixes
fixes #373 fixes bug that misses current translation unit's scope when resolving entry-point global type argument expression.
Diffstat (limited to 'source/slang/check.cpp')
-rw-r--r--source/slang/check.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/slang/check.cpp b/source/slang/check.cpp
index 7cfb317fb..c4aa9bfba 100644
--- a/source/slang/check.cpp
+++ b/source/slang/check.cpp
@@ -6944,14 +6944,18 @@ namespace Slang
entryPoint->decl = entryPointFuncDecl;
// Lookup generic parameter types in global scope
+ List<RefPtr<Scope>> scopesToTry;
+ scopesToTry.Add(entryPoint->getTranslationUnit()->SyntaxNode->scope);
+ for (auto & module : entryPoint->compileRequest->loadedModulesList)
+ scopesToTry.Add(module->moduleDecl->scope);
for (auto name : entryPoint->genericParameterTypeNames)
{
// parse type name
RefPtr<Type> type;
- for (auto & module : entryPoint->compileRequest->loadedModulesList)
+ for (auto & s : scopesToTry)
{
RefPtr<Expr> typeExpr = entryPoint->compileRequest->parseTypeString(entryPoint->getTranslationUnit(),
- name, module->moduleDecl->scope);
+ name, s);
DiagnosticSink nSink;
SemanticsVisitor visitor(
&nSink,