summaryrefslogtreecommitdiffstats
path: root/source/slang/slang.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-09-05 11:53:14 -0700
committerGitHub <noreply@github.com>2024-09-05 11:53:14 -0700
commit879ee3d187e577189eba9aed7bc6326b740cb627 (patch)
tree2317bf727e7958efacea24a3bcf6534a44c1827f /source/slang/slang.cpp
parenta3b25ceb4021811d481c9c4a07a8d029329f01f3 (diff)
Support entrypoints defined in a namespace. (#5011)
* Support entrypoints defined in a namespace. * Fix test.
Diffstat (limited to 'source/slang/slang.cpp')
-rw-r--r--source/slang/slang.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index 4a6d33363..b0898b1a0 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -2328,7 +2328,14 @@ DeclRef<Decl> ComponentType::findDeclFromString(
{
result = declRefExpr->declRef;
}
-
+ else if (auto overloadedExpr = as<OverloadedExpr>(checkedExpr))
+ {
+ sink->diagnose(SourceLoc(), Diagnostics::ambiguousReference, name);
+ for (auto candidate : overloadedExpr->lookupResult2)
+ {
+ sink->diagnose(candidate.declRef.getDecl(), Diagnostics::overloadCandidate, candidate.declRef);
+ }
+ }
m_decls[name] = result;
return result;
}