Skip to content

Revert "lookup: prefer Swift types over Clang ones when multiple types are present in lookup" #40474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions lib/Sema/TypeCheckType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1423,21 +1423,6 @@ static void diagnoseAmbiguousMemberType(Type baseTy, SourceRange baseRange,
}
}

static LookupTypeResult preferSwiftTypes(LookupTypeResult results) {
if (results.size() == 1)
return results;
LookupTypeResult newResults;
for (auto cur: results) {
if (cur.Member->getClangNode()) {
continue;
}
newResults.addResult(cur);
}
if (newResults.size() == 1)
return newResults;
return results;
}

/// Resolve the given identifier type representation as a qualified
/// lookup within the given parent type, returning the type it
/// references.
Expand Down Expand Up @@ -1548,9 +1533,6 @@ static Type resolveNestedIdentTypeComponent(TypeResolution resolution,
memberTypes = TypeChecker::lookupMemberType(
DC, parentTy, comp->getNameRef(), lookupOptions);

// Prefer Swift types over Clang types.
memberTypes = preferSwiftTypes(memberTypes);

// Name lookup was ambiguous. Complain.
// FIXME: Could try to apply generic arguments first, and see whether
// that resolves things. But do we really want that to succeed?
Expand Down