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

[SR-3310] Property observer/Setter patterns that should always error #45898

Open
swift-ci opened this issue Dec 2, 2016 · 2 comments
Open

[SR-3310] Property observer/Setter patterns that should always error #45898

swift-ci opened this issue Dec 2, 2016 · 2 comments
Labels
compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation improvement

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Dec 2, 2016

Previous ID SR-3310
Radar None
Original Reporter erica (JIRA User)
Type Improvement
Additional Detail from JIRA
Votes 1
Component/s Compiler
Labels Improvement, DiagnosticsQoI
Assignee None
Priority Medium

md5: dc81bc16cefec566c317ed7e128c744d

Issue Description:

Swift should warn or, preferably, error on `set(oldValue)`, `willSet(oldValue)`, and `didSet(newValue)`, since these can be considered to be always a priori written in error.

@swift-ci
Copy link
Collaborator Author

Comment by Christopher Hatton (JIRA)

Perhaps you can explain more - does it matter if the new or old values are explicitly given the same name as the default? This sounds like a purely stylistic issue with no effect on semantics.

@swift-ci
Copy link
Collaborator Author

Comment by erica sadun (JIRA)

Perhaps you can explain more - does it matter if the new or old values are explicitly given the same name as the default? This sounds like a purely stylistic issue with no effect on semantics.

These are known a priori to violate intended semantics.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation improvement
Projects
None yet
Development

No branches or pull requests

1 participant