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-11066] False positive "never mutated" warning when property with mutating getter is accessed on value #53458

Closed
jckarter opened this issue Jul 3, 2019 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation good first issue Good for newcomers

Comments

@jckarter
Copy link
Member

jckarter commented Jul 3, 2019

Previous ID SR-11066
Radar None
Original Reporter @jckarter
Type Bug
Status Resolved
Resolution Duplicate
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, StarterBug
Assignee None
Priority Medium

md5: d4eed7ca9a1123a2444c66129d325ed0

duplicates:

  • SR-10123 Spurious warning about mutable struct

Issue Description:

https://twitter.com/iljawascoding/status/1146402744070221824

In the second picture, the user has a `var` of struct type on which they're accessing a `lazy` property. The compiler incorrectly warns that the `var` is never mutated, even though reading the lazy property has a mutating getter, so reading it does require mutating the variable.

@theblixguy
Copy link
Collaborator

Looks like SR-10123 and I think we would need to bring back LValueAccessKind in order to fix this.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants