Commit Graph

22 Commits

Author SHA1 Message Date
Michael Gottesman
3ed4059a60 [sema] Change non-sendable -> non-Sendable in diagnostics.
This matches send non sendable but importantly also makes it clear that we are
talking about something that doesn't conform to the Sendable protocol which is
capitalized.

rdar://151802975
2025-05-22 11:37:58 -07:00
Anthony
c9b17383c8 Grammatical corrections for compound modifiers 2025-04-24 09:21:32 +02:00
Daniel Rodríguez Troitiño
ba68faaed5 [test] Mark tests that use experimental/upcoming features as such
Find all the usages of `--enable-experimental-feature` or
`--enable-upcoming-feature` in the tests and replace some of the
`REQUIRES: asserts` to use `REQUIRES: swift-feature-Foo` instead, which
should correctly apply to depending on the asserts/noasserts mode of the
toolchain for each feature.

Remove some comments that talked about enabling asserts since they don't
apply anymore (but I might had miss some).

All this was done with an automated script, so some formatting weirdness
might happen, but I hope I fixed most of those.

There might be some tests that were `REQUIRES: asserts` that might run
in `noasserts` toolchains now. This will normally be because their
feature went from experimental to upcoming/base and the tests were not
updated.
2024-11-02 11:46:46 -07:00
Michael Gottesman
de85b79423 [concurrency] Make GlobalActorIsolatedTypesUsability an upcoming swift 6 feature.
rdar://118244451
2024-05-13 18:40:58 -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
Sima Nerush
f1bb9c845e Merge pull request #72473 from simanerush/nonisolated-property-struct-inference
[Concurrency] Infer `nonisolated` for a mutable storage of a value type accessed from within the module.
2024-03-25 09:36:36 -07:00
Sima Nerush
05859b442c [Features] Gate global-actor-isolated types usability changes behind an experimental feature flag. 2024-03-23 20:03:01 -07:00
Sima Nerush
043cc26661 [Concurrency] Infer nonisolated for a mutable storage of a value type accessed from within the module. 2024-03-23 20:01:45 -07:00
Pavel Yaskevich
681d1605af [CSSimplify] Allow type inference through marker protocol existential casts
```swift
class A<T> {
}

class B<U> : A<U> {
}

func test(v: any B<Int> & Sendable) {
  _ = v as A // infers `Int` for `A.T`
}
```
2024-03-11 10:38:46 -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
Slava Pestov
780c4e9a6d Sema: Fix isValidKeyPathDynamicMemberLookup() for noncopyable generics 2024-02-24 07:25:59 -05:00
Kavon Farvardin
f296d8e158 NCGenerics: mass XFAIL tests
It's easier to get a handle on regressions while working through
failures if the tests that are known to not pass are XFAIL'd for
NoncopyableGenerics.
2024-02-20 18:26:05 -05: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
359ea14df9 [TypeChecker] TypeChecker::isSubtypeOf should recognize Sendable subtyping
A sendable type can be a subtype of a non-Sendable type, i.e.
`any X & Sendable` vs. `X` where `X` is a class. The solver
adjusts `MissingSynthesizableConformance` to indicate that
one of the types is missing `Sendable` and that needs to be
recognized by `TypeChecker::isSubtypeOf`.
2023-12-20 11:02:12 -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