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-13735] Missed @actorIndependent check in computed properties #56132

Closed
kavon opened this issue Oct 14, 2020 · 1 comment
Closed

[SR-13735] Missed @actorIndependent check in computed properties #56132

kavon opened this issue Oct 14, 2020 · 1 comment
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself concurrency Feature: umbrella label for concurrency language features

Comments

@kavon
Copy link
Contributor

kavon commented Oct 14, 2020

Previous ID SR-13735
Radar None
Original Reporter @kavon
Type Bug
Status Resolved
Resolution Cannot Reproduce
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Concurrency
Assignee @kavon
Priority Medium

md5: d5875bbef08b908b1ef09b85847bcdd7

Issue Description:

Consider this:

actor class Bug1 {
  var counter : Int = 0

  @actorIndependent
  var halfCounter : Int { counter / 2 } // FIXME: should report an error!
}

The access to `counter` is not safe. Currently, this is not caught by the type checker. This applies to computed properties with getter and setter, along with subscript member of an actor class.

@kavon
Copy link
Contributor Author

kavon commented Oct 14, 2020

After updating to the latest commits in main, this problem was addressed already.

@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 concurrency Feature: umbrella label for concurrency language features
Projects
None yet
Development

No branches or pull requests

1 participant