Commit Graph

29 Commits

Author SHA1 Message Date
Konrad 'ktoso' Malawski
03774d245a fix some tests due to diagnostic rewording 2025-07-15 11:16:13 +09:00
Konrad 'ktoso' Malawski
f52f445358 [Concurrency] add fixit to add final to non-sendable class -> Sendable
The previous message was just suggesting unchecked Sendable, but instead
we should be suggesting to add final to the class. We also don't
outright suggest using unchecked Sendable -- following
https://github.com/swiftlang/swift/pull/81738 precedent.

Resolves rdar://155790695
2025-07-15 10:42:25 +09:00
Allan Shortlidge
75bad99f78 Tests: Remove -disable-availability-checking in Distributed tests.
Use the `%target-swift-5.X-abi-triple` substitutions to compile the tests for
deployment to the minimum OS versions required for the APIs used in the tests,
instead of disabling availability checking.
2024-10-20 09:07:13 -07:00
Alex Hoppen
66104395d7 [Sema/SourceKit] Emit same diagnostics for missing protocol requirements on the command line and in SourceKit
Some editors use diagnostics from SourceKit to replace build issues. This causes issues if the diagnostics from SourceKit are formatted differently than the build issues. Make sure they are rendered the same way, removing most uses of `DiagnosticsEditorMode`.

To do so, always emit the `add stubs for conformance` note (which previously was only emitted in editor mode) and remove all `; add <something>` suffixes from notes that state which requirements are missing.

rdar://129283608
2024-08-07 14:01:30 -07:00
Holly Borla
c20b0e0956 [Concurrency] Obsolete AnyActor in Swift 6 using a typealias. 2024-05-29 22:59:19 -07:00
Holly Borla
1011e4ddb0 [Concurrency] Only deprecate AnyActor, and update more tests.
Obsoleting `AnyActor` in Swift 6 blocks the Concurrency library itself
from migrating to Swift 6, because `Actor` and `DistributedActor` have to
preserve their refinement of `AnyActor` to avoid breaking code currently
using the marker protocol. There's no way to move protocol refinement into
an extension so that the use-site declaration can be obsoleted, so we're
stuck with just the deprecation of `AnyActor`.
2024-05-24 12:58:02 -07:00
Slava Pestov
af8c8f1671 Sema: Remove non-experimental associated type inference 2024-03-07 17:30:17 -05:00
Slava Pestov
2ed50ec276 Sema: If the structural occurs check skips a witness, treat it as tautological
Fixes rdar://problem/122584912.
2024-02-10 17:20:14 -05:00
Slava Pestov
28f26216ee Sema: Refactor evaluateMembersRequest() to not call TypeChecker::checkConformance() 2024-01-31 21:56:57 -05:00
Slava Pestov
f5ccc3248d Update Distributed/actor_protocols.swift for minor diagnostic change with -enable-experimental-associated-type-inference 2024-01-25 21:55:43 -05:00
Konrad `ktoso` Malawski
b666fc672e [Executors] Remote distributed actors get "crash on enqueue" default executor (#64969) 2023-04-10 19:12:03 +09:00
Konrad `ktoso` Malawski
345c221f56 [Concurrency] Distributed actor's unownedExecutor should be optional (#64499) 2023-03-22 08:40:41 +09:00
Konrad `ktoso` Malawski
53168355f0 [Distributed] Explicitly ban a class extending AnyActor as well 2022-06-22 09:21:55 +09:00
Konrad `ktoso` Malawski
edd5880a59 [Distributed] SerializationReq must be associated type on DA 2022-04-13 21:52:15 +09:00
Anthony Latsis
ba7f301e83 ConformanceChecker: Always diagnose a conformance failure if the requirement check fails in 'ensureRequirementsAreSatisfied' 2022-03-28 23:22:36 +03:00
Konrad `ktoso` Malawski
8c13370242 [Distributed] rename _Distributed to underscoreless module 2022-03-16 08:35:35 +09:00
Konrad `ktoso` Malawski
13cc8b3157 [Distributed] Enable no-longer-experimental distributed by default 2022-03-11 22:14:49 +09:00
Konrad `ktoso` Malawski
040a4a318c [Concurrency][Distributed] Move AnyActor to Concurrency module 2022-03-08 15:28:30 +09:00
Konrad `ktoso` Malawski
cee89ec541 [Distributed] DistributedActorSystem renaming and redesign (#40387)
* [Distributed] towards DistributedActorSystem; synthesize the id earlier, since Identifiable.id

* Fix execute signature to what Pavel is working with

* funcs are ok in sil

* fixed lifetime of id in inits

* fix distributed_actor_deinit

* distributed_actor_local

* update more tests

fixing tests

fix TBD test

fix Serialization/distributed

fix irgen test

Fix null pointer crashes

* prevent issues with null func ptrs and fix Distributed prorotocol test

* fix deinit sil test
2021-12-13 11:29:25 +09:00
Konrad `ktoso` Malawski
61a1bc2a6c [Distributed] remove public default AnyActorTransport alias
The previously set public AnyActorTransport was a temporary thing,
and instead we want to set this in every module that declares such
actors.
2021-11-04 15:54:56 +09:00
Doug Gregor
c2ba06c3d2 Make the actor transport an associated type of the DistributedActor protocol.
Eliminate the required use of existentials in distributed actors by
introducing the `Transport` associated type into the
`DistributedActor` protocol. Each distributed actor has a known
(concrete) actor transport type, reducing storage requirements and
transport dynamism when it isn't needed.

Distributed actors can manually specify their `Transport` associated
type or pick up a default by looking for a type named
`DefaultActorTransport`. A library that vends an actor transport can
make create a public typealias `DefaultActorTransport` referring to
its transport, so importing that library and defining a distributed
actor will use that library's transport.

Introduce a type-erased `AnyActorTransport` type to provide an
explicitly dynamic actor transport. This is still an important option,
e.g., for cases where one wants to be able to dynamically change the
transport for testing or different kinds of deployment. For now, we
default to this transport in the library (via `DefaultActorTransport`),
but we may very well want to eliminate this because it will be
ambiguous with client libraries that vend their own
`DefaultActorTransport`.
2021-11-01 22:37:33 -07:00
Konrad `ktoso` Malawski
480bb082a9 [Distributed] Naive impl of whenLocal for distributed actors (#39654)
* [Distributed] Hacky impl of whenLocal for distributed actors

* cleanup & fix one test

* disable test on windows
2021-10-10 12:44:57 +09:00
Konrad `ktoso` Malawski
14c432c11d cleanup 2021-10-05 06:31:50 +09:00
Slava Pestov
c8f3476f19 Don't use back-quotes in diagnostics 2021-09-15 18:38:34 -04:00
Konrad `ktoso` Malawski
ac6bee45db [Distributed] SIL invocation of initialize remote done 2021-08-12 14:09:01 +09:00
Doug Gregor
1e2012d816 Disable availability checking in tests that use concurrency 2021-07-20 12:46:26 -07:00
Konrad `ktoso` Malawski
716a0255c0 [Distributed] Move to ActorIdentity protocol (#38362) 2021-07-15 21:13:55 +09:00
Doug Gregor
e595b4f68a [SE-0306] Ban "open" and "required" on actors.
Because actors don't have inheritance, ban "open" and "required", which
don't make sense. We will permit "final" which, although it doesn't
have any semantic impact, is still used to determine whether the ABI
of the actor itself might permit subclassing in the future. This
leaves the door slightly ajar for actor inheritance should we need to
revisit that decision.

Fixes SR-14785 / rdar://79401150.
2021-06-30 16:34:18 -07:00
Konrad `ktoso` Malawski
eada7df0e4 Ban classes from extending Actor and DistributedActor protocol explicitly (#38050)
* [Concurrency,Distributed] ban inheriting Actor and DistActor explicitly by class

* [Distributed] AnyActor can be a marker protocol
2021-06-25 06:06:35 +09:00