Commit Graph

18 Commits

Author SHA1 Message Date
Doug Gregor
95e12ca584 Don't apply @Sendable to enum cases in pattern matching 2024-06-13 11:56:18 -07:00
Doug Gregor
c65264738b Treat references to enum cases with associated values as @Sendable functions
When `InferSendableFromCaptures`, make sure to treat references to enum
cases that have associated values as `@Sendable` functions.
2024-06-12 14:58:56 -07:00
Doug Gregor
290ec7915b Respect @preconcurrency in the diagnostic for @Sendable methods of non-Sendable types 2024-05-16 21:36:37 -07:00
Pavel Yaskevich
6a60588fa1 [Tests] NFC: Add a test-case for rdar://125932231 2024-04-05 00:25:20 -07:00
Pavel Yaskevich
0a49d2868c Partially revert: "[TypeChecker] TypeChecker::isSubtypeOf should recognize @sendable subtyping"
Reverts code chagnes introduced by 5626881da1 but leaves (modified) test-cases

This approach regressed existing ternary expressions that join to `any Sendable`
and one branch is inferred from the ternary type variable.
2024-04-05 00:23:52 -07:00
Pavel Yaskevich
d6f57c932d [Tests] NFC: Add a test-case for rdar://119593407 2024-03-22 09:20:45 -07:00
Pavel Yaskevich
a7f9a689fc [ConstraintSystem] Move @Sendable inference for partially applied members to adjustFunctionTypeForConcurrency 2024-03-22 09:02:32 -07:00
Pavel Yaskevich
d49445beed Merge pull request #70502 from xedin/subtype-between-sendable-and-non-sendable
[TypeChecker] `TypeChecker::isSubtypeOf` should recognize Sendable s…
2024-03-08 12:05:43 -08:00
Holly Borla
9ba481ad53 [Diagnostics] Clarify the wording of error_in_future_swift_version. 2024-03-01 12:05:51 -08:00
Pavel Yaskevich
c7c7df3329 [Frontend] NFC: Promote InferSendableFromCaptures to an upcoming feature in Swift 6 2024-02-01 10:56:22 -08:00
Pavel Yaskevich
5626881da1 [TypeChecker] TypeChecker::isSubtypeOf should recognize @Sendable subtyping
A sendable function can be a subtype of a non-@Sendable function,
that is currently established via a fix. `TypeChecker::isSubtypeOf`
should recognize its presence and fail.
2023-12-20 11:01:40 -08:00
Pavel Yaskevich
a8232123c9 [ConstraintSystem] Fix isPartialApplication to properly handle static members
Only instance members require double-apply to be fully applied,
static members apply the base implicitly.
2023-11-29 17:00:38 -08:00
Angela Laar
c09ec72e85 [Constraint System] Always add Sendable to unapplied function applications 2023-11-07 13:37:24 -08:00
Angela Laar
619a517a61 [CSSimplify] Check all conditional requirements for a type variable 2023-10-25 12:30:50 -07:00
Angela Laar
4bd4fa6479 [Sema] Use checkGenericArguments 2023-10-25 12:30:27 -07:00
Angela Laar
34ca702031 [Frontend] Feature flag for InferredSendableMethods 2023-10-25 12:30:24 -07:00
Angela Laar
9e408af419 [Sema] Global funcs should always be Sendable
Global funcs should be Sendable by default because they don't
capture anything.
2023-10-25 12:29:37 -07:00
Angela Laar
4028f15f7b [test] add sendable method and function tests 2023-10-25 12:29:37 -07:00