We had fixed this bug in https://github.com/swiftlang/swift/pull/79381
but missed to realize the same problem existed for parameters as well.
This corrects the swift_func_getParameterTypeInfo impl, and also removes
the entire "unsafe" method, we no longer use it anywhere.
Resolves rdar://146679254
This corrects how we were dealing with dispatch thunks -- mostly be
removing a lot of special casing we did but doesn't seem necessary and
instead we correct and emit all the necessary information int TBD.
This builds on https://github.com/swiftlang/swift/pull/74935 by further refining how we fixed that issue, and adds more regression tests. It also removes a load of special casing of distributed thunks in library evolution mode, which is great.
Resolves and adds regression test for for rdar://145292018
This is also a more proper fix to the previously resolved but in a not-great-way which caused other issues:
- resolves rdar://128284016
- resolves rdar://128310903
* [Distributed] Accessor must be available cross module in resilient mode
This is an important fix for libraries using @Resolvable in resilient
libraries. Without the fix we're missing an accessor and this will fail
some remote calls which make use of remote calls on resolvable
protocols. This would manifest as missing accessor error thrown by the
executeDistributedTarget function.
resolves rdar://148224780
* Disable test on windows since %env not supported
* [Distributed] Dont emit TBD also for distributed thunks
This resolves pedantic "all" TBD validation issues, i.e. we dont emit
unexpected records anymore - we would before as we only checked for
is_distributed but we also want to skip those for is_distributed_thunk
resolves rdar://128284016
* [Distributed] Accessor must be available cross module in resilient mode
This is an important fix for libraries using @Resolvable in resilient
libraries. Without the fix we're missing an accessor and this will fail
some remote calls which make use of remote calls on resolvable
protocols. This would manifest as missing accessor error thrown by the
executeDistributedTarget function.
resolves rdar://148224780
* Disable test on windows since %env not supported
This is a crucial fix without which we can crash on some distributed
protocol declarations with @Resolvable. We cannot "just" use a String to
represent the "fake base" of the thunks, and must instead find the
$Target macro generated type and use it as the base of the thunk's
mangling.
Calls are made in such way that record for the protocol requirement:
`$s4main28GreeterDefinedSystemProtocolP5greetSSyYaKFTEHF` points at
`$$s4main29$GreeterDefinedSystemProtocolC5greetSSyYaKFTE` which makes a
dispatch through the _apropriate_ witness table.
And the record for the $witness named e.g.
`$s4main29$GreeterDefinedSystemProtocolC5greetSSyYaKFTEHF` points to
`$s4main28GreeterDefinedSystemProtocolPAA11Distributed01_F9ActorStubRzrlE5greetSSyYaKFTE`
which is an extension method: `distributed thunk (extension in main):main.GreeterDefinedSystemProtocol< where A: Distributed._DistributedActorStub>.greet() async throws -> Swift.String`,
this very specific design allows us to call the "right method" on the
recieving end of a remote call where we do not know the recipient type.
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.
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.
Use the `%target-swift-5.1-abi-triple` substitution to compile the tests for
deployment to the minimum OS versions required for use of _Concurrency APIs,
instead of disabling availability checking.
The isolation checker was assuming that one can only be isolated to a
specific var, but that's not true for distributed actors -- because the
default parameter emitted by #isolation is a method call -- converting
the self into an any Actor.
We must handle this in isolation checker in order to avoid thinking
we're crossing isolation boundaries and making methods implicitly async
etc, when we're actually not.
resolves rdar://131874709