Swift interfaces have both attribute and all publicly accessible
synthesized members, which means that the synthesis needs to be
taught to lookup existing synthesized declarations for `$storage`,
`$Storage`, and `init(storageWrapper:)` if request comes for
declaration that belongs to a Swift interface file.
The request is updated to return attribute, wrapper declaration,
the declaration its attached to and whether or not it has been
inferred (opposite to being declared directly).
https://github.com/apple/swift/pull/42041 introduced a centralized mechanism for adding the `nonisolated` attribute to synthesized decls but did not clean up the existing code that was already doing so for `Hashable` conformances.
Resolves rdar://102106591
Adding a type wrapper attribute on a protocol does two things:
- Synthesizes `associatedtype $Storage` declaration with `internal` access
- Synthesizes `var $storage: <#Wrapper#><Self, Self.$Storage>` value requirement
ObjC classes which have only factory and convenience initializers cannot allow their convenience inits to be inherited. To provide these classes with a reliable opt-out, tweak support for @_hasMissingDesignatedInitializers so that it affects ObjC classes even if they’re in the same module as one another.
Fixes rdar://48511013.
If there are no type wrapper ignored stored properties, the
compiler would synthesize a special public initializer that
allows to initialize a wrapped type by providing a fully
initialized wrapper instance.
Emit a call to a helper function that determines whether the symbols associated with the declaration referenced in the `#_hasSymbol(...)` condition are non-null at runtime. An upcoming change will emit a definition for this function during IRGen.
Resolves rdar://100130015
It was done in `maybeAddTypeWrapperDefaultArg` before because
user-defined initializers weren't supported but now property
initializers need to be subsumed earlier to make sure that
SILGen doesn't try to emit them into user-defined initializers.
If a stored property would be in a default memberwise initializer
it would be added to the `init` synthesized for a type wrapped type
as well i.e. a `let` property without a default.
Since properties with property wrappers are not supported, default
init synthesis needs to handle them as well by using correct interface
type depending on outer wrapper capabilities and setting correct
default expression.
Synthesize an `init` declaration which is going to initialize
type wrapper instance property `$_storage` via user provided
values for all stored properties.
Compiler cannot synthesize regular memberwise or default
initializers for type wrapped types because stored properties
of such a type cannot be accessed directly.
A special initializer would be synthesized instead, it is going
to initialize `$_storage` variable and handle default initialization
of stored properties.
MSVC isn't seeing that `CheckDefaultInitializer` is declared and being
implicitly captured by reference by the closure going into the
`forEachVariable`.
Capturing `HasStorage` and `CheckDefaultInitializer` explicitly.
When deriving witnesses for protocol conformances within an
actor-isolated type, make those members 'nonisolated'. In the case
where this would work, for example because some of the state is
mutable, don't allow derivation of those witnesses.
Fixes rdar://90233250.
* [Distributed] dist actor always has default executor (currently)
* [Distributed] extra test for missing makeEncoder
* [DistributedDecl] Add DistributedActorSystem to known SDK types
* [DistributedActor] ok progress on getting the system via witness
* [Distributed] allow hop-to `let any: any X` where X is DistActor
* [Distributed] AST: Add an accessor to determine whether type is distributed actor
- Classes have specialized method on their declarations
- Archetypes and existentials check their conformances for
presence of `DistributedActor` protocol.
* [Distributed] AST: Account for distributed members declared in class extensions
`getConcreteReplacementForProtocolActorSystemType` should use `getSelfClassDecl`
otherwise it wouldn't be able to find actor if the member is declared in an extension.
* [Distributed] fix ad-hoc requirement checks for 'mutating'
[PreChecker] LookupDC might be null, so account for that
* [Distributed] Completed AST synthesis for dist thunk
* [Distributed][ASTDumper] print pretty distributed in right color in AST dumps
* wip on making the local/remote calls
* using the _local to mark the localCall as known local
* [Distributed] fix passing Never when not throwing
* fix lifetime of mangled string
* [Distributed] Implement recordGenericSubstitution
* [Distributed] Dont add .
* [Distributed] dont emit thunk when func broken
* [Distributed] fix tests; cleanups
* [Distributed] cleanup, move is... funcs to DistributedDecl
* [Distributed] Remove SILGen for distributed thunks, it is in Sema now!
* [Distributed] no need to check stored props in protocols
* remote not used flag
* fix mangling test
* [Distributed] Synthesis: Don't re-use AST nodes for `decodeArgument` references
* [Distributed] Synthesis: Make sure that each thunk parameter has an internal name
* [Distributed/Synthesis] NFC: Add a comment regarding empty internal parameter names
* [Distributed] NFC: Adjust distributed thunk manglings in the accessor section test-cases
* cleanup
* [Distributed] NFC: Adjust distributed thunk manglings in the accessor thunk test-cases
* review follow ups
* xfail some linux tests for now so we can land the AST thunk
* Update distributed_actor_remote_functions.swift
Co-authored-by: Pavel Yaskevich <xedin@apache.org>
* [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