diff options
Diffstat (limited to 'source/slang')
| -rw-r--r-- | source/slang/slang-check-expr.cpp | 6 | ||||
| -rw-r--r-- | source/slang/slang-check-overload.cpp | 2 |
2 files changed, 6 insertions, 2 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>()) 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) |
