From dd3d80e61b316390a468a142de2be2fb85b73d0d Mon Sep 17 00:00:00 2001 From: Sai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:27:50 -0400 Subject: Allow lookups of overloaded methods. (#5110) * Allow lookups of overloaded methods. * Update slang-reflection-api.cpp * Update slang.cpp --------- Co-authored-by: Yong He --- source/slang/slang-check-shader.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'source/slang/slang-check-shader.cpp') diff --git a/source/slang/slang-check-shader.cpp b/source/slang/slang-check-shader.cpp index 1718c3afd..08bac1f78 100644 --- a/source/slang/slang-check-shader.cpp +++ b/source/slang/slang-check-shader.cpp @@ -235,8 +235,17 @@ namespace Slang Name* name, DiagnosticSink* sink) { - auto declRef = translationUnit->findDeclFromString(getText(name), sink); - FuncDecl* entryPointFuncDecl = declRef.as().getDecl(); + FuncDecl* entryPointFuncDecl = nullptr; + + auto expr = translationUnit->findDeclFromString(getText(name), sink); + if (auto declRefExpr = as(expr)) + { + auto declRef = declRefExpr->declRef; + entryPointFuncDecl = declRef.as().getDecl(); + + if (entryPointFuncDecl && getModule(entryPointFuncDecl) != translationUnit) + entryPointFuncDecl = nullptr; + } if (entryPointFuncDecl && getModule(entryPointFuncDecl) != translationUnit) entryPointFuncDecl = nullptr; -- cgit v1.2.3