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

[4.0] [Type checker] Check type equality even for argument tuples in Swift 4. #10447

Merged

Conversation

DougGregor
Copy link
Member

Explanation: In Swift 4 mode, comparisons of single-parameter, unlabeled functions could fail when the parameter types were different spellings of the same type. This manifested in nonsensical failures with protocol conformance checking, but could happen in a number of places.
Scope: Obviously-correct code that works in Swift 3.2 mode would fail (or produce weird results) in Swift 4 mode. We've only pinned a single SR/radar on this bug, but I highly suspect that there are others.
Radar: SR-5166 / rdar://problem/32666189.
Risk: Fairly low; the change is localized to Swift 4 mode and "obviously" an improvement of what we previously had.
Testing: New test + normal compiler regression testing.

Replace a where Type-pointer-equality check with what it intended,
i.e., match up ParenTypes at the top level and perform a deeper
equality comparison of the underlying types.

Fixes SR-5166 / rdar://problem/32666189.

(cherry picked from commit a570a5a)
@DougGregor DougGregor added this to the Swift 4.0 milestone Jun 21, 2017
@DougGregor
Copy link
Member Author

@swift-ci please test

Copy link
Member

@rudkx rudkx left a comment

Choose a reason for hiding this comment

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

Yes, LGTM!

@tkremenek tkremenek merged commit 3f0f5df into apple:swift-4.0-branch Jun 21, 2017
@DougGregor DougGregor deleted the paren-type-equality-4.0 branch June 21, 2017 23:30
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.

None yet

3 participants