Skip to content

[5.9] SE-0365 bug fixes #65355

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

Merged
merged 7 commits into from
May 16, 2023
Merged

Conversation

calda
Copy link
Contributor

@calda calda commented Apr 21, 2023

This PR cherry picks two bug fixes for SE-0365 into the Swift 5.9 release branch.

I CP'd both of these changes in the same PR because the implementation of #65310 depends on changes in #65211


Examples of code that is currently rejected in Swift 5.8 / 5.9 but compiles successfully with these changes as expected by SE-0365:

class Test {
  func method() { }
  
  func foo(condition: Bool) {
    doVoidStuff { [weak self] in
      guard condition, let self else { return }
      method() // 🛑 Unexpected error: call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit
    }
  }
}
doVoidStuff { [weak self] in
  guard let self else { return }
  func innerFunction() {
    // 🛑 Error: call to method 'test' in closure requires explicit use of 'self' to make capture semantics explicit
    test()
  }
}

@xedin
Copy link
Contributor

xedin commented Apr 21, 2023

@swift-ci please test

@xedin xedin requested a review from hborla April 21, 2023 17:23
@AnthonyLatsis AnthonyLatsis added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.9 labels May 3, 2023
@hborla
Copy link
Member

hborla commented May 15, 2023

@swift-ci please test

@calda
Copy link
Contributor Author

calda commented May 16, 2023

Looks like the Swift Test macOS Platform job failed in update-checkout. Smoke tests passed though.

@xedin
Copy link
Contributor

xedin commented May 16, 2023

@swift-ci please test macOS platform

@calda
Copy link
Contributor Author

calda commented May 16, 2023

All green now, thanks @xedin

@xedin xedin merged commit 3e97b1f into swiftlang:release/5.9 May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants