Skip to content

Sema: Clean up name lookup and fix a couple of bugs #4143

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
Aug 9, 2016

Conversation

slavapestov
Copy link
Contributor

No description provided.

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

Previously, qualified lookup would use a metatype to signal
to the LookupResultBuilder that conformance checks should not
be used to resolve protocol members found with a concrete
type base. This is too subtle for my taste. Add an explicit
flag and clean up some usages, fixing <rdar://problem/16123805>.

Also, clean up the 'CheckProtocolMembers' flag. We now set
when the base type is an archetype, and correctly handle
the concept of an abstract conformance. This finally
fixes <rdar://problem/22776964>.
@slavapestov slavapestov force-pushed the name-lookup-cleanup branch from 842791d to d5c2f44 Compare August 9, 2016 07:54
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@jrose-apple
Copy link
Contributor

I feel like a "don't perform conformance checks" flag is a bit more than just a clean-up. Can you talk more about what this is doing and why it's safe?

@slavapestov
Copy link
Contributor Author

@jrose-apple The flag just makes the old behavior explicit where passing in a nominal type would allow conformance checks, but passing in a metatype would not.

@slavapestov
Copy link
Contributor Author

We don't want to do conformance checks when matching protocol witnesses for example, to avoid runaway recursion. However we do want witness lookup to consider protocol extension members.

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov merged commit ad445d0 into swiftlang:master Aug 9, 2016
@slavapestov slavapestov deleted the name-lookup-cleanup branch August 19, 2016 05:21
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