Skip to content

lookup: prefer Swift types over Clang ones when multiple types are present in lookup #40440

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 7, 2021

Conversation

nkcsgexi
Copy link
Contributor

@nkcsgexi nkcsgexi commented Dec 6, 2021

No description provided.

@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Dec 6, 2021

@swift-ci please smoke test

@@ -1533,6 +1548,9 @@ static Type resolveNestedIdentTypeComponent(TypeResolution resolution,
memberTypes = TypeChecker::lookupMemberType(
DC, parentTy, comp->getNameRef(), lookupOptions);

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test case? Should this go inside lookupMemberType() instead, since there are other callers of lookupMemberType() elsewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add a test case. I'm not sure about adding this to lookupMemberType() because code completion may show less results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants