Skip to content

Merge main 2022-03-11 #4362

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 107 commits into from
Mar 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
db97c0d
[APIJSON] Impromve tests to it doesn't rely on SDK content
cachemeifyoucan Mar 3, 2022
837586f
[Concurrency] Use separate signpost name for task_flags_changed.
mikeash Mar 4, 2022
4b85670
[swift-inspect] Fix some missing type conversions when targeting watc…
mikeash Mar 4, 2022
9ad8798
Fix typo in getting started, and update example for creating the cxx…
cabmeurer Mar 7, 2022
bcddc9b
[utils] Force subprocess output to be read in text mode
lorentey Mar 8, 2022
040a4a3
[Concurrency][Distributed] Move AnyActor to Concurrency module
ktoso Mar 8, 2022
369f3e6
[Concurrency] ignore @_marker protocol AnyActor ABI warnings
ktoso Mar 8, 2022
e8891b6
[test] XFAIL dependent-types.swift on 32 bit platforms
hamishknight Mar 8, 2022
f789974
Cleaning up anchor finding in interpolated strings
etcwilde Mar 8, 2022
02a13f3
Allow explicit "as <existential-type>" to disable implicit opening of…
DougGregor Mar 1, 2022
8224335
Remove dead find/filter-Constraints functions from the constraint solver
DougGregor Mar 8, 2022
69c998f
[Constraint system] Have simplifyOpenedExistentialOfConstraint use op…
DougGregor Mar 8, 2022
08e417c
Eliminate unnecessary check for opaque types.
DougGregor Mar 8, 2022
a67a62b
Merge pull request #41726 from hamishknight/xfail-dependent-types
hamishknight Mar 8, 2022
d0e377e
[utils] Use Python 2 compatible name for text=True
lorentey Mar 8, 2022
a2c7f63
[move-function-addr] Add a small comment to the checker.
gottesmm Mar 3, 2022
2af1460
[AutoDiff] Introduce regression test for SR-15849 (#41717)
philipturner Mar 8, 2022
d5f63ee
Enable Sendability for AsyncStream and AsyncThrowingStream (#41713)
phausler Mar 8, 2022
db63c21
Merge pull request #41729 from DougGregor/opened-existential-cleanups
DougGregor Mar 8, 2022
b7bdb91
AST: Allow type parameters in superclass bound in ASTContext::getOpen…
slavapestov Mar 8, 2022
21def03
Revert "AST: Temporarily remove calls to TypeBase::getMinimalCanonica…
slavapestov Mar 8, 2022
033b8bf
Merge pull request #41722 from ktoso/wip-move-anyactor
ktoso Mar 8, 2022
b292512
Parse: Add availability macro support to @_backDeploy attribute parsi…
tshortli Mar 7, 2022
486940b
Merge pull request #41731 from gottesmm/pr-3f9436cebb06906a5bfc4c8e9f…
gottesmm Mar 8, 2022
343caa5
Merge pull request #41651 from cachemeifyoucan/eng/PR-89448415
cachemeifyoucan Mar 8, 2022
e6d8912
Merge pull request #41712 from cabmeurer/cxx-interop/Fix-typo-update-…
zoecarver Mar 9, 2022
da265fe
[utils] shell.run: Stop printing the cwd to stdout before each command
lorentey Mar 9, 2022
a11b8d9
[utils] shell.run: Flush stdout/stderr after printing
lorentey Mar 9, 2022
bc6a38c
Merge pull request #41733 from slavapestov/reenable-minimal-canonical…
slavapestov Mar 9, 2022
713e0a4
RequirementMachine: Reduce replacement paths for redundant rules to l…
slavapestov Mar 1, 2022
a0c3045
RequirementMachine: Relax criterion for deleting a useless loop
slavapestov Mar 8, 2022
95f122f
RequirementMachine: Add -enable-requirement-machine-loop-normalizatio…
slavapestov Mar 8, 2022
4f9cf1d
[utils] update_checkout: During parallel execution, prefix each print…
lorentey Mar 9, 2022
b6a641b
RequirementMachine: New way of introducing concrete conformance rules
slavapestov Mar 9, 2022
cfdb937
AST: Stricter invariants in GenericSignature::verify()
slavapestov Mar 8, 2022
d73689f
[test] lit.cfg: TARGET_ENV_PREFIX ⟹ config.target_env_prefix
lorentey Mar 9, 2022
4b881cf
[test] lit.cfg: Introduce config.target_library_path_var for the corr…
lorentey Mar 9, 2022
1a31f38
[test] lit.cfg: List the contents of the remote directory after upload
lorentey Mar 9, 2022
e2f7d51
Register Parameterized Protocol Abbreviation
CodaFi Feb 28, 2022
3b3ff6a
Define Mangling for ParameterizedProtocol
CodaFi Feb 24, 2022
f7b2a8e
Pretty-Print Bound Demangled Parameterized Protocols
CodaFi Feb 28, 2022
e3119a8
Allow Retrieving Nominal Types from PPTs
CodaFi Mar 1, 2022
635d253
Unify ParameterizedProtocolTypes
CodaFi Mar 1, 2022
e2ed202
Unlock Parameterized Existentials Behind 'any'
CodaFi Mar 9, 2022
3f8e4e7
AST: Fix mistake with generic signature in findExistentialSelfReferen…
slavapestov Mar 9, 2022
4efcb82
Unlock Opaque Types in Parameterized Protocols
CodaFi Mar 9, 2022
0c529b0
Merge pull request #41714 from lorentey/fix-update-checkout-output
lorentey Mar 9, 2022
a62a5ca
SILMem2Reg: fix a problem with leaking enum values
eeckstein Mar 8, 2022
9d78186
tests: disable sil_verify_all_triggers_verifier_without_asserts.sil
eeckstein Mar 9, 2022
bfac01f
Merge pull request #41741 from lorentey/lit-cleanups
lorentey Mar 9, 2022
4beadfe
Merge pull request #41744 from eeckstein/fix-mem2reg
swift-ci Mar 9, 2022
79dcb57
Merge pull request #41745 from eeckstein/disable-test
swift-ci Mar 9, 2022
f204f06
Add a build option for the concurrency tracing feature.
al45tair Mar 9, 2022
a872ee0
[test] Disable typeref_decoding_objc.swift on arm64e
hamishknight Mar 9, 2022
05a3f1f
Merge pull request #41748 from hamishknight/disable-typeref-decoding-…
hamishknight Mar 9, 2022
6a020f8
Stabilize and simplify SIL linkage and serialization
eeckstein Mar 7, 2022
a182a70
[test] Disable a couple of DebugInfo tests
hamishknight Mar 9, 2022
cb902d5
Merge pull request #41749 from hamishknight/disable-debug-tests-harder
hamishknight Mar 9, 2022
187e6f3
[test] Disable ArrayTrapsObjC.swift for backdeployment
hamishknight Mar 9, 2022
c361a49
Merge pull request #41750 from hamishknight/disable-array-trap-backde…
hamishknight Mar 9, 2022
b71dc9c
Merge pull request #41742 from slavapestov/fix-find-existential-self-…
slavapestov Mar 9, 2022
8df83fe
Merge pull request #41614 from slavapestov/rqm-left-canonical-form
slavapestov Mar 9, 2022
3508d41
[Mem2Reg] Skip load [take] of cast projections.
nate-chandler Mar 9, 2022
f24cf9a
Enable Requirement Machine unconditionally for test/Prototypes/BigInt…
slavapestov Mar 9, 2022
322ffc3
Merge pull request #41672 from mikeash/fix-swift-inspect-watchos
mikeash Mar 9, 2022
d1b60c8
Merge pull request #41670 from mikeash/signpost-task-flags-changed
mikeash Mar 9, 2022
44a9753
Merge pull request #41703 from eeckstein/simplify-linkage
eeckstein Mar 9, 2022
b8370d6
[nfc] Use `^stdlib` not `stdlib` for lit regex filter.
zoecarver Mar 8, 2022
4ffde96
[SSADestroyHoisting] Fixed pointer handling.
nate-chandler Feb 22, 2022
c1adf24
[MemAccessUtils] Returned visitor's return.
nate-chandler Mar 3, 2022
2855198
Merge pull request #41732 from zoecarver/fix-lit-filter-stdlib
hamishknight Mar 9, 2022
8da37b0
Merge pull request #41734 from tshortli/accept-availability-macros-in…
tshortli Mar 9, 2022
0aead28
Add a Compiler Crasher
CodaFi Mar 9, 2022
c9d202e
Merge pull request #41752 from slavapestov/bigint-test
slavapestov Mar 9, 2022
cf05e61
Merge pull request #41723 from etcwilde/ewilde/garden-anchors
etcwilde Mar 9, 2022
5bb40ae
Sema: Fix doesMemberHaveUnfulfillableConstraintsWithExistentialBase()…
slavapestov Mar 9, 2022
512ebc5
Merge pull request #41743 from CodaFi/existential-dread
CodaFi Mar 9, 2022
599bb79
Sema: Generalize the 'invariant Self requirement' check to handle a r…
slavapestov Mar 9, 2022
4a5962f
Merge pull request #41754 from nate-chandler/mem_access_utils/unique_…
nate-chandler Mar 10, 2022
009ed74
Merge pull request #41753 from nate-chandler/lexical_lifetimes/lexica…
nate-chandler Mar 10, 2022
4343d94
Merge pull request #41751 from nate-chandler/mem2reg/bail-on-load-tak…
nate-chandler Mar 10, 2022
a6b586d
Ensure that we print @Sendable when printing TypeReprs.
DougGregor Mar 10, 2022
e05b011
[docs] NFC, fix typo CppInteropability -> CppInteroperability
hyp Mar 10, 2022
1ff3fda
Merge pull request #41757 from slavapestov/protocol-self-reference-fixes
slavapestov Mar 10, 2022
79533bb
Merge pull request #41761 from hyp/fix-docs-typo
hyp Mar 10, 2022
0d87a10
Merge pull request #41746 from al45tair/eng/PR-89787540
al45tair Mar 10, 2022
231af68
[cxx-interop] Enable a test on Linux
egorzhdan Mar 10, 2022
5ab8e08
[Distributed] Reimplement distributed call thunks completely in AST (…
ktoso Mar 10, 2022
cf47090
Add testcase for fixed circular reference issue: rdar://89921930
slavapestov Mar 10, 2022
9e919fd
Merge pull request #41765 from apple/egorzhdan/cxx-test-linux
egorzhdan Mar 10, 2022
1466afc
Ensure that emit unnamed isolated parameters
DougGregor Mar 10, 2022
09cdd36
[c++-interop] For failed imports in ClangImporter, cache them regardl…
plotfi Mar 10, 2022
323238f
Merge pull request #41760 from DougGregor/print-sendable-typereprs
DougGregor Mar 10, 2022
f014e9f
Merge pull request #41766 from slavapestov/test-rdar89921930.swift
slavapestov Mar 10, 2022
3b97bd5
[Distributed] NFC: Allow 64-bit distributed test only on x86_64 and a…
xedin Mar 11, 2022
5f42dd5
Merge pull request #41775 from xedin/disable-64-bit-test-on-32bit-sim…
kavon Mar 11, 2022
58f0a1c
[Distributed] Disable some tests on optimized builds until we fix
ktoso Mar 11, 2022
d42593a
[Distributed] better diagnostics for missing actor system typealias
ktoso Mar 1, 2022
25370d2
Merge pull request #41776 from ktoso/wip-disable-opt
kavon Mar 11, 2022
ea89407
Extend the lifetime of the buffer while copying from a _CocoaArrayWra…
DougGregor Mar 11, 2022
f2d60e1
[Distributed] add note explaining DefaultDistributedActorSystem
ktoso Mar 11, 2022
a024e8f
Merge pull request #41602 from ktoso/wip-better-error
swift-ci Mar 11, 2022
459fb37
Merge pull request #41768 from DougGregor/emit-unnamed-isolated-params
DougGregor Mar 11, 2022
07bb2b1
Merge pull request #41779 from DougGregor/extend-cocoaarray-buffer
DougGregor Mar 11, 2022
dc75476
Merge remote-tracking branch 'apple/main' into katei/merge-main-2022-…
kateinoigakukun Mar 11, 2022
2def3c5
[Wasm] Disable os_stdlib tests for WASI due to no dynamic loading
kateinoigakukun Mar 11, 2022
6309754
[Wasm] Clean build-sdk on self-hosted machine
kateinoigakukun Mar 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .github/workflows/build-toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,12 @@ jobs:
restore-keys: |
${{ matrix.target }}-sccache-v11-

- name: Clean stdlib build directory
- name: Clean build directory
if: ${{ matrix.clean_build_dir }}
run: |
rm -rf ${{ github.workspace }}/target-build \
${{ github.workspace }}/host-build \
${{ github.workspace }}/build-sdk \
${{ github.workspace }}/host-toolchain-sdk \
${{ github.workspace }}/dist-toolchain-sdk

Expand Down
1 change: 1 addition & 0 deletions docs/ABI/Mangling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@ Types
type ::= protocol-list 'p' // existential type
type ::= protocol-list superclass 'Xc' // existential type with superclass
type ::= protocol-list 'Xl' // existential type with AnyObject
type ::= protocol-list 'y' (type* '_')* type* retroactive-conformance* 'Xp' // parameterized protocol type
type ::= type-list 't' // tuple
type ::= type generic-signature 'u' // generic type
type ::= 'x' // generic param, depth=0, idx=0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,23 @@ struct ContentView: View {
```

```
//In Cxx.cpp
//In Cxx.hpp

#ifndef Cxx_hpp
#define Cxx_hpp

#include "Cxx.hpp"
int cxxFunction(int n) {
return n;
}

#endif
```

```
//In Cxx.hpp

#ifndef Cxx_hpp
#define Cxx_hpp
//In Cxx.cpp

#include "Cxx.hpp"
int cxxFunction(int n);

#endif

```

Expand Down Expand Up @@ -198,7 +197,7 @@ CxxInterop.main()

```

- In your projects direcetoy, run `cmake` to generate the systems build files
- In your project's directory, run `cmake` to generate the systems build files

- To generate an Xcode project run `cmake -GXcode`
- To generate with Ninja run `cmake -GNinja`
Expand Down
10 changes: 10 additions & 0 deletions docs/ReferenceGuides/UnderscoredAttributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -830,10 +830,20 @@ the compiler.

This `async` function uses the pre-SE-0338 semantics of unsafely inheriting the caller's executor. This is an underscored feature because the right way of inheriting an executor is to pass in the required executor and switch to it. Unfortunately, there are functions in the standard library which need to inherit their caller's executor but cannot change their ABI because they were not defined as `@_alwaysEmitIntoClient` in the initial release.


## `@_spi_available(platform, version)`

Like `@available`, this attribute indicates a decl is available only as an SPI.
This implies several behavioral changes comparing to regular `@available`:
1. Type checker diagnoses when a client accidently exposes such a symbol in library APIs.
2. When emitting public interfaces, `@_spi_available` is printed as `@available(platform, unavailable)`.
3. ClangImporter imports ObjC macros `SPI_AVAILABLE` and `__SPI_AVAILABLE` to this attribute.


## `_local`

A distributed actor can be marked as "known to be local" which allows avoiding
the distributed actor isolation checks. This is used for things like `whenLocal`
where the actor passed to the closure is known-to-be-local, and similarly a
`self` of obtained from an _isolated_ function inside a distributed actor is
also guaranteed to be local by construction.
9 changes: 4 additions & 5 deletions include/swift/AST/ASTContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -658,12 +658,11 @@ class ASTContext final {

/// Retrieve the declaration of DistributedActorSystem.make().
///
/// \param actorOrSystem distributed actor or actor system to get the
/// remoteCall function for. Since the method we're looking for is an ad-hoc
/// requirement, a specific type MUST be passed here as it is not possible
/// to obtain the decl from just the `DistributedActorSystem` protocol type.
/// \param thunk the function from which we'll be invoking things on the obtained
/// actor system; This way we'll always get the right type, taking care of any
/// where clauses etc.
FuncDecl *getMakeInvocationEncoderOnDistributedActorSystem(
NominalTypeDecl *actorOrSystem) const;
AbstractFunctionDecl *thunk) const;

// Retrieve the declaration of
// DistributedInvocationEncoder.recordGenericSubstitution(_:).
Expand Down
2 changes: 2 additions & 0 deletions include/swift/AST/ASTDemangler.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ class ASTBuilder {
bool isClassBound,
bool forRequirement = true);

Type createParameterizedProtocolType(Type base, ArrayRef<Type> args);

Type createExistentialMetatypeType(Type instance,
Optional<Demangle::ImplMetatypeRepresentation> repr=None);

Expand Down
8 changes: 8 additions & 0 deletions include/swift/AST/Attr.def
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ TYPE_ATTR(async)
TYPE_ATTR(Sendable)
TYPE_ATTR(unchecked)
TYPE_ATTR(_typeSequence)
TYPE_ATTR(_local)

// SIL-specific attributes
TYPE_ATTR(block_storage)
Expand Down Expand Up @@ -720,6 +721,13 @@ DECL_ATTR(_backDeploy, BackDeploy,
ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIBreakingToRemove,
129)

CONTEXTUAL_SIMPLE_DECL_ATTR(_local, KnownToBeLocal,
DeclModifier | OnFunc | OnParam | OnVar |
DistributedOnly |
ABIBreakingToAdd | ABIBreakingToRemove |
APIBreakingToAdd | APIBreakingToRemove,
130)

// If you're adding a new underscored attribute here, please document it in
// docs/ReferenceGuides/UnderscoredAttributes.md.

Expand Down
28 changes: 22 additions & 6 deletions include/swift/AST/Decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2693,8 +2693,7 @@ class ValueDecl : public Decl {
/// property, or the uncurried result type of a method/subscript, e.g.
/// '() -> () -> Self'.
GenericParameterReferenceInfo findExistentialSelfReferences(
Type baseTy, const DeclContext *useDC,
bool treatNonResultCovariantSelfAsInvariant) const;
Type baseTy, bool treatNonResultCovariantSelfAsInvariant) const;
};

/// This is a common base class for declarations which declare a type.
Expand Down Expand Up @@ -4491,10 +4490,6 @@ class ProtocolDecl final : public NominalTypeDecl {
/// semantics but has no corresponding witness table.
bool isMarkerProtocol() const;

/// Is a protocol that can only be conformed by distributed actors.
/// Such protocols are allowed to contain distributed functions.
bool inheritsFromDistributedActor() const;

private:
void computeKnownProtocolKind() const;

Expand Down Expand Up @@ -5255,6 +5250,10 @@ class VarDecl : public AbstractStorageDecl {
/// Does this have a 'distributed' modifier?
bool isDistributed() const;

/// Is this var known to be a "local" distributed actor,
/// if so the implicit throwing ans some isolation checks can be skipped.
bool isKnownToBeLocal() const;

/// Is this a stored property that will _not_ trigger any user-defined code
/// upon any kind of access?
bool isOrdinaryStoredProperty() const;
Expand Down Expand Up @@ -6309,6 +6308,13 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
/// Returns 'true' if the function is distributed.
bool isDistributed() const;

/// For a 'distributed' target (func or computed property),
/// get the 'thunk' responsible for performing the 'remoteCall'.
///
/// \return the synthesized thunk, or null if the base of the call has
/// diagnosed errors during type checking.
FuncDecl *getDistributedThunk() const;

/// Returns 'true' if the function has the @c @_backDeploy attribute.
bool isBackDeployed() const;

Expand Down Expand Up @@ -6456,6 +6462,16 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
/// 'DistributedActorSystem' protocol.
bool isDistributedActorSystemRemoteCall(bool isVoidReturn) const;

/// Determines whether this function is a 'makeInvocationEncoder' function,
/// which is used as ad-hoc protocol requirement by the
/// 'DistributedActorSystem' protocol.
bool isDistributedActorSystemMakeInvocationEncoder() const;

/// Determines if this function is a 'recordGenericSubstitution' function,
/// which is used as ad-hoc protocol requirement by the
/// 'DistributedTargetInvocationEncoder' protocol.
bool isDistributedTargetInvocationEncoderRecordGenericSubstitution() const;

/// Determines if this function is a 'recordArgument' function,
/// which is used as ad-hoc protocol requirement by the
/// 'DistributedTargetInvocationEncoder' protocol.
Expand Down
30 changes: 0 additions & 30 deletions include/swift/AST/DiagnosticsParse.def
Original file line number Diff line number Diff line change
Expand Up @@ -1561,46 +1561,16 @@ ERROR(attr_availability_duplicate,none,
(StringRef, StringRef))

// originallyDefinedIn
// FIXME(backDeploy): Refactor to share with back deployment attr
ERROR(originally_defined_in_missing_rparen,none,
"expected ')' in @_originallyDefinedIn argument list", ())

// FIXME(backDeploy): Refactor to share with back deployment attr
ERROR(originally_defined_in_unrecognized_platform,none,
"unrecognized platform name in @_originallyDefinedIn argument list", ())

// FIXME: This is unused and can be removed
ERROR(originally_defined_in_unrecognized_property,none,
"unrecognized property in @_originallyDefinedIn argument list", ())

ERROR(originally_defined_in_need_original_module_name,none,
"expected 'module: \"original\"' in the first argument to "
"@_originallyDefinedIn", ())

ERROR(originally_defined_in_need_nonempty_module_name,none,
"original module name cannot be empty in @_originallyDefinedIn", ())

// FIXME(backDeploy): Refactor to share with back deployment attr
ERROR(originally_defined_in_need_platform_version,none,
"expected at least one platform version in @_originallyDefinedIn", ())

// FIXME(backDeploy): Refactor to share with back deployment attr
WARNING(originally_defined_in_major_minor_only,none,
"@_originallyDefinedIn only uses major and minor version number", ())

// FIXME(backDeploy): Refactor to share with back deployment attr
WARNING(originally_defined_in_missing_platform_name,none,
"* as platform name has no effect", ())

// FIXME(backDeploy): Refactor to share with back deployment attr
WARNING(originally_defined_in_swift_version, none,
"Swift language version checks has no effect "
"in @_originallyDefinedIn", ())

WARNING(originally_defined_in_package_description, none,
"PackageDescription version checks has no effect "
"in @_originallyDefinedIn", ())

// backDeploy
ERROR(attr_back_deploy_missing_rparen,none,
"expected ')' in '@_backDeploy' argument list", ())
Expand Down
14 changes: 12 additions & 2 deletions include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -1935,8 +1935,8 @@ WARNING(type_does_not_conform_swiftui_warning,none,

ERROR(non_final_class_cannot_conform_to_self_same_type,none,
"non-final class %0 cannot safely conform to protocol %1, "
"which requires that 'Self' is exactly equal to %2",
(Type, Type, Type))
"which requires that %2 %select{is exactly equal to|inherit from}3 %4",
(Type, Type, Type, unsigned, Type))

ERROR(cannot_use_nil_with_this_type,none,
"'nil' cannot be used in context expecting type %0", (Type))
Expand Down Expand Up @@ -4495,6 +4495,13 @@ ERROR(actor_inheritance,none,
ERROR(actor_protocol_illegal_inheritance,none,
"non-actor type %0 cannot conform to the 'Actor' protocol",
(DeclName))
ERROR(distributed_actor_conformance_missing_system_type,none,
"distributed actor %0 does not declare ActorSystem it can be used with.",
(DeclName))
NOTE(note_distributed_actor_system_can_be_defined_using_defaultdistributedactorsystem,none,
"you can provide a module-wide default actor system by declaring:\n"
"typealias DefaultDistributedActorSystem = <#ConcreteActorSystem#>\n",
())
ERROR(distributed_actor_protocol_illegal_inheritance,none,
"non-distributed actor type %0 cannot conform to the 'DistributedActor' protocol",
(DeclName))
Expand Down Expand Up @@ -4595,6 +4602,9 @@ NOTE(note_distributed_actor_isolated_method,none,
ERROR(distributed_actor_isolated_method,none,
"only 'distributed' instance methods can be called on a potentially remote distributed actor",
())
ERROR(distributed_local_cannot_be_used,none,
"'local' cannot be used in user-defined code currently",
())
ERROR(distributed_actor_func_param_not_codable,none,
"parameter '%0' of type %1 in %2 does not conform to serialization requirement '%3'",
(StringRef, Type, DescriptiveDeclKind, StringRef))
Expand Down
22 changes: 15 additions & 7 deletions include/swift/AST/DistributedDecl.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ class DeclContext;
class FuncDecl;
class NominalTypeDecl;

/// Determine the concrete type of 'ActorSystem' as seen from the member.
/// E.g. when in a protocol, and trying to determine what the actor system was
/// constrained to.
///
/// \param member the member from which context the lookup should be performed,
/// e.g. a function or computed property.
/// \return the concrete type of the ActorSystem to be used by this member,
/// or null if no concrete actor system was found.
Type getConcreteReplacementForProtocolActorSystemType(ValueDecl *member);

/// Determine the `ActorSystem` type for the given actor.
Type getDistributedActorSystemType(NominalTypeDecl *actor);

Expand All @@ -43,14 +53,12 @@ Type getDistributedActorIDType(NominalTypeDecl *actor);
Type getDistributedSerializationRequirementType(
NominalTypeDecl *nominal, ProtocolDecl *protocol);

///// Determine the serialization requirement for the given actor, actor system
///// or other type that has the SerializationRequirement associated type.
//Type getDistributedSerializationRequirementType(
// NominalTypeDecl *nominal, ProtocolDecl *protocol);

Type getDistributedActorSystemActorIDRequirementType(
NominalTypeDecl *system);
/// Get the specific 'InvocationEncoder' type of a specific distributed actor
/// system.
Type getDistributedActorSystemInvocationEncoderType(NominalTypeDecl *system);

/// Get the 'ActorID' type of a specific distributed actor system.
Type getDistributedActorSystemActorIDRequirementType(NominalTypeDecl *system);

/// Get the specific protocols that the `SerializationRequirement` specifies,
/// and all parameters / return types of distributed targets must conform to.
Expand Down
Loading