Skip to content

[6.1][Concurrency] Fix a few issues with matching any Sendable to Any #79430

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 5 commits into from
Feb 18, 2025

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Feb 17, 2025

Cherry-pick of #79382 and #78789


  • Explanation:

    • Allows Any to be matched against any Sendable when it appears in generic argument position of a value
      passed as an inout argument (both explicit and implicit).

    • Downgrades a few Sendable conformance diagnostics to warnings in Swift 6 mode when base of a member reference or assignment destination are marked as @preconcurrency.

    • A minor diagnostic improvement for generic argument mismatch with leading-dot syntax.

  • Main Branch PRs: [Concurrency] Fix a few issues with Senable and Any #79382 and [Diagnostics] Fix generic arguments mismatch diagnostic related to le… #78789

  • Risk: Low (allows some code that previously was rejected by the compiler to type-check successfully).

  • Resolves: rdar://144794132

  • Reviewed By: @hborla

  • Testing: Added new tests to the Concurrency/SILGen and Interprete test suites.

(cherry picked from commit 00fe563)

…ading-dot syntax

`GenericArgumentsMismatchFailure` missed a case where location
of the failure points to a member spelled with leading-dot syntax.
…whether access is mutating or not

Otherwise `inout` uses of declarations that require ABI safe conversions
are going to be diagnosed as non-mutating.

(cherry picked from commit ff5e2dd)
@xedin xedin requested a review from a team as a code owner February 17, 2025 09:13
@xedin xedin requested a review from hborla February 17, 2025 09:13
@xedin
Copy link
Contributor Author

xedin commented Feb 17, 2025

@swift-ci please test

@xedin xedin added the 🍒 release cherry pick Flag: Release branch cherry picks label Feb 17, 2025
…positions

It should be possible to pass values with `any Sendable` as arguments
to `inout` parameters that expect `Any`. This is pretty much the same
as an l-value conversion.

Resolves: swiftlang#79361
Resolves: rdar://144794132
(cherry picked from commit 484e0a7)
…expressions

This expands swiftlang#77510 to base
expressions of calls, subscripts and members to make sure that if
the base has `@preconcurrency` declaration at some level. Otherwise,
the availability checker won't appropriately downgrade unavailable
`Sendable` conformances for `@preconcurrency` declarations.

(cherry picked from commit aa0b356)
…ignments

If destination is marked as `@preconcurrency` the Sendable conformance
errors should be downgraded to warnings even in Swift 6 mode just like
for member and subscript references.

(cherry picked from commit f474588)
@xedin xedin force-pushed the more-Sendable-to-Any-problems-6.1 branch from 5412e2b to 0a237ae Compare February 17, 2025 17:39
@xedin
Copy link
Contributor Author

xedin commented Feb 17, 2025

@swift-ci please test

@xedin xedin changed the title [6.1][Concurency] Fix a few issues with matching any Sendable to Any [6.1][Concurrency] Fix a few issues with matching any Sendable to Any Feb 17, 2025
@xedin xedin merged commit abab647 into swiftlang:release/6.1 Feb 18, 2025
5 checks passed
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants