summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-expr.cpp
diff options
context:
space:
mode:
authorSai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com>2025-02-27 10:28:13 -0800
committerGitHub <noreply@github.com>2025-02-27 10:28:13 -0800
commit1fb3c1536587d6ed085f13af78101cbfb3481dca (patch)
tree14347c566f1567bebe0f8f95b3488bc90b09a271 /source/slang/slang-check-expr.cpp
parent3c096a7d3e796850ab6a54e50bb33595483ec7bd (diff)
Fix overload resolution for `ModuleDeclarationDecl` (#6483)
* Fix overload resolution for `MemberExp`r's base expression Also fixed an issue where `ModuleDeclarationDecl` priority during overload resolution was inverted. * Made the fix slightly simpler.. * Update overload-resolve.slang
Diffstat (limited to 'source/slang/slang-check-expr.cpp')
-rw-r--r--source/slang/slang-check-expr.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/slang/slang-check-expr.cpp b/source/slang/slang-check-expr.cpp
index 1fb2b336f..b249bb343 100644
--- a/source/slang/slang-check-expr.cpp
+++ b/source/slang/slang-check-expr.cpp
@@ -4848,17 +4848,21 @@ Expr* SemanticsVisitor::maybeInsertImplicitOpForMemberBase(
//
baseExpr = maybeOpenExistential(baseExpr);
+ // In case our base expressin is still overloaded, we can perform
+ // some more refinement.
+ //
// Handle the case of an overloaded base expression
// here, in case we can use the name of the member to
// disambiguate which of the candidates is meant, or if
// we can return an overloaded result.
+ //
if (auto overloadedExpr = as<OverloadedExpr>(baseExpr))
{
// If a member (dynamic or static) lookup result contains both the actual definition
// and the interface definition obtained from inheritance, we want to filter out
// the interface definitions.
LookupResult filteredLookupResult;
- for (auto lookupResult : overloadedExpr->lookupResult2)
+ for (auto lookupResult : overloadedExpr->lookupResult2.items)
{
bool shouldRemove = false;
if (lookupResult.declRef.getParent().as<InterfaceDecl>())