Skip to content

[Exclusivity] Relax closure enforcement on separate stored properties #10789

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

devincoughlin
Copy link
Contributor

@devincoughlin devincoughlin commented Jul 6, 2017

Make the static enforcement of accesses in noescape closures stored-property
sensitive. This will relax the existing enforcement so that the following is
not diagnosed:

struct MyStruct {
var x = X()
var y = Y()

mutating
func foo() {
x.mutatesAndTakesClosure() {
_ = y.read() // no-warning
}
}
}

To do this, update the access summary analysis to summarize accesses to
subpaths of a capture.

rdar://problem/32987932

@devincoughlin
Copy link
Contributor Author

@swift-ci Please test Linux

Make the static enforcement of accesses in noescape closures stored-property
sensitive. This will relax the existing enforcement so that the following is
not diagnosed:

struct MyStruct {
   var x = X()
   var y = Y()

  mutating
  func foo() {
    x.mutatesAndTakesClosure() {
      _ = y.read() // no-warning
   }
  }
}

To do this, update the access summary analysis to summarize accesses to
subpaths of a capture.

rdar://problem/32987932
@devincoughlin devincoughlin force-pushed the exclusivity-interprocedural-separate-stored-structs-round2 branch from 7557712 to 7d1cdca Compare July 10, 2017 18:57
@devincoughlin devincoughlin changed the title [WIP DO NOT MERGE] Revert "Revert "[Exclusivity] Relax closure enforc… [Exclusivity] Relax closure enforcement on separate stored properties Jul 10, 2017
@devincoughlin devincoughlin changed the title [Exclusivity] Relax closure enforcement on separate stored properties [Exclusivity] Relax closure enforcement on separate stored properties #10789 Jul 10, 2017
@devincoughlin devincoughlin changed the title [Exclusivity] Relax closure enforcement on separate stored properties #10789 [Exclusivity] Relax closure enforcement on separate stored properties Jul 10, 2017
@devincoughlin
Copy link
Contributor Author

@swift-ci Please test and merge

@devincoughlin devincoughlin merged commit 47d9de9 into swiftlang:master Jul 10, 2017
devincoughlin added a commit to devincoughlin/swift that referenced this pull request Jul 10, 2017
…swiftlang#10789)

Make the static enforcement of accesses in noescape closures stored-property
sensitive. This will relax the existing enforcement so that the following is
not diagnosed:

struct MyStruct {
   var x = X()
   var y = Y()

  mutating
  func foo() {
    x.mutatesAndTakesClosure() {
      _ = y.read() // no-warning
   }
  }
}

To do this, update the access summary analysis to summarize accesses to
subpaths of a capture.

rdar://problem/32987932
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