summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-overload.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-overload.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-overload.cpp')
-rw-r--r--source/slang/slang-check-overload.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/slang/slang-check-overload.cpp b/source/slang/slang-check-overload.cpp
index 01cd303c7..5e55eb70f 100644
--- a/source/slang/slang-check-overload.cpp
+++ b/source/slang/slang-check-overload.cpp
@@ -1345,7 +1345,7 @@ int SemanticsVisitor::CompareLookupResultItems(
bool leftIsModule = (as<ModuleDeclarationDecl>(left.declRef) != nullptr);
bool rightIsModule = (as<ModuleDeclarationDecl>(right.declRef) != nullptr);
if (leftIsModule != rightIsModule)
- return int(rightIsModule) - int(leftIsModule);
+ return int(leftIsModule) - int(rightIsModule);
// If both are interface requirements, prefer the more derived interface.
if (leftIsInterfaceRequirement && rightIsInterfaceRequirement)