Commit Graph

8 Commits

Author SHA1 Message Date
Pavel Yaskevich
c7c7df3329 [Frontend] NFC: Promote InferSendableFromCaptures to an upcoming feature in Swift 6 2024-02-01 10:56:22 -08:00
Pavel Yaskevich
fe2f1cab52 [CSBindings] Make it possible to enumerate supertypes of existentials
- Drop `mayHaveSuperclass` because it's too restrictive.
- Add logic to get superclass of existential and re-create
  existential type with all of the protocol requirements.
2023-12-19 13:36:35 -08:00
Pavel Yaskevich
bb20c7a66a [CSBindings] keypath-to-function conversion should respect sendability of the key path
If the underlying key path is not Sendable, the compiler generated
closure that captures the key path expression (as `{ [$kp$ = ...] in $0[keyPath: $kp$] }`)
cannot be marked as Sendable either.
2023-12-11 11:33:46 -08:00
Pavel Yaskevich
e561ac4966 [Concurrency] Print full isolation information when diagnosing key path components 2023-12-07 15:41:37 -08:00
Pavel Yaskevich
9a529e9634 [Concurrency] Start diagnosing use of global actor isolated properties in key paths
If key path is formed in a concurrency domain different from the
one where the member is, diagnose that as a warning until Swift 6.
2023-12-07 15:41:32 -08:00
Pavel Yaskevich
b8d5e4c1c7 [ConstraintSystem] InferSendableFromCaptures: Use of actor isolated members makes key path non-Sendable 2023-12-06 12:21:12 -08:00
Pavel Yaskevich
da052e5b27 [TypeChecker] Allow @dynamicMemberLookup subscript index to compose key path with protocols
Allow to compose key path type with a protocol as a way to express
additional requirements on the parameter. For example:

```
struct Test<R> {
  subscript<V>(dynamicMember member: KeyPath<R, V> & Sendable) -> V {
    ...
  }
}
```
2023-11-30 11:34:58 -08:00
Pavel Yaskevich
3d6ddd58c8 [TypeChecker] NFC: Add test-cases verify that sendability of key path exprs is inferred correctly 2023-11-28 13:48:00 -08:00