Skip to content

Commit

Permalink
Only repeat lookupIdentifier when result is ambiguous
Browse files Browse the repository at this point in the history
Signed-off-by: Anna Rift <[email protected]>
  • Loading branch information
riftEmber committed Sep 17, 2024
1 parent 9768d57 commit b23a3c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions frontend/lib/resolution/Resolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2996,10 +2996,10 @@ void Resolver::resolveIdentifier(const Identifier* ident) {
auto parenlessInfo = ParenlessOverloadInfo();
auto ids = lookupIdentifier(ident, resolvingCalledIdent, parenlessInfo);

// If we looked up a called identifier and got no method results,
// repeat lookup for the identifier as though it wasn't called, to support
// implicit 'this' calls.
if (resolvingCalledIdent && !ids.isEmpty()) {
// If we looked up a called identifier and found ambiguity but no method
// results, repeat lookup for the identifier as though it wasn't called, to
// support implicit 'this' calls.
if (resolvingCalledIdent && ids.numIds() > 1) {
bool anyMethod = false;
for (auto idIt = ids.begin(); idIt != ids.end(); ++idIt) {
if (idIt.curIdAndFlags().isMethod()) {
Expand Down

0 comments on commit b23a3c8

Please sign in to comment.