Skip to content
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

Sema: Gut synthesizeMemberForLookup() #16054

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Apr 20, 2018

More cleanups based off of #16053.

@slavapestov slavapestov force-pushed the gut-synthesize-member-for-lookup branch 2 times, most recently from 43f77de to baa01da Compare April 20, 2018 09:01
@slavapestov slavapestov requested a review from itaiferber April 20, 2018 09:02
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov requested a review from xedin April 20, 2018 09:16
@slavapestov slavapestov force-pushed the gut-synthesize-member-for-lookup branch from baa01da to b2d0124 Compare April 20, 2018 15:24
@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - b2d01245248ead24ccd9413f22c0467d2ba34248

Copy link
Contributor

@itaiferber itaiferber left a comment

Choose a reason for hiding this comment

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

Looks good from my (limited) end! Significant cleanup here, and it's more elegant to boot. Thanks 🙂

… checking

This is a more elegant path to ensuring that init(from:) and encode(to:)
get synthesized than synthesizeMemberForLookup().
…irements

Since init(from:) and encode(to:) are protocol requirements, any
name lookup of them will find the protocol requirement, and if
the witness is not present we will synthesize it on the spot.

Only CodingKeys requires special handling here, since it is not
a protocol requirement, but has to get synthesized anyway.
@slavapestov slavapestov force-pushed the gut-synthesize-member-for-lookup branch from b2d0124 to d8b4d99 Compare April 20, 2018 22:30
@slavapestov
Copy link
Contributor Author

Thanks for taking a look! As you’ve noticed this cleanup caused a test failure. I merged the other fixes though since they don’t depend on this, they should all be in swift-4.2-branch now. I’ll revisit this PR later.

Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

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

LGTM! Small nit - there is a typo (than right before synthesizeMemberForLookup) in the first commit message.

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.

4 participants