Skip to content

[4.2] Sema: Diagnose completely unapplied references to mutating methods. #17653

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

Conversation

jckarter
Copy link
Contributor

Explanation: The currying behavior of method references completely breaks in the face of inout semantics, even moreso with exclusivity enforcement, but we failed to diagnose these references in Swift 4 and previous versions. Raises a compatibility warning when these references are found in Swift 4 code, or error in Swift 5 and later.

Scope: Warns about an unsupportable invalid code formation that was accidentally accepted.

Issue: rdar://problem/41361334 | SR-8074.

Risk: Low, introduces a warning for code that would be miscompiled

Testing: Swift CI, compatibility suite

Reviewed by: @slavapestov

The currying behavior of method references completely breaks in the face of `inout` semantics, even moreso with exclusivity enforcement, but we failed to diagnose these references in Swift 4 and previous versions. Raise a compatibility warning when these references are found in Swift 4 code, or error in Swift 5 and later. Simplify the partial application logic here slightly too now that standalone functions do not allow currying. Addresses rdar://problem/41361334 | SR-8074.
@jckarter
Copy link
Contributor Author

@swift-ci Please test

@jckarter
Copy link
Contributor Author

@swift-ci Please test source compatibility

@jckarter
Copy link
Contributor Author

@swift-ci Please nominate

@jckarter jckarter merged commit 6079032 into swiftlang:swift-4.2-branch Jul 1, 2018
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.

1 participant