Skip to content

Conversation

@slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Apr 13, 2024

  • Description: Adding some new assertions on main exposed bugs where isolation checking was looking at captures before they were computed, or before they could be computed because the AST was not yet type checked. Other than doing repeated work from visiting children unnecessarily, the only real issue here was that if you had a closure nested inside of another closure inside a stored property initializer, we didn't diagnose non-Sendable captures in -swift-version 6 mode.
  • Scope of the issue: I discovered these problems myself while fixing on something else but it would've come up eventually.
  • Tested: There's a new test case that used to work but wasn't covered by existing tests (top-level computed property in script mode) and a test case that did not diagnose correctly (the nested closure in initializer thing).
  • Risk: Low.
  • Reviewed by: @hborla

Due to a quirk of the ASTVisitor, we would then visit
accessors twice, the first time as part of the
PatternBindingDecl inside the TopLevelCodeDecl, and
at that point the accessor body has not yet been
type checked.
Otherwise, we'll miss captures inside closures inside stored property
initializer expressions.
@slavapestov slavapestov requested a review from a team as a code owner April 13, 2024 13:42
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@xavgru12
Copy link

I went through the logs of the failed step and found:

ˋˋˋ
hudson.AbortException: script returned exit code 1
ˋˋˋ

Where exactly did it fail?

@slavapestov
Copy link
Contributor Author

@swift-ci Please test macOS

@slavapestov slavapestov merged commit 055888f into swiftlang:release/6.0 Apr 16, 2024
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.

3 participants