[6.2][Distributed] Allow disabling SerializationRequirement by using Any #84252
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description: It is possible to customize the SerializationRequirement that DistributedActorSystem enforces on all parameters/return types. When this was set to
Any
, which can be useful for some special in memory transports, the compiler would emit incorrect code and cause a crash due to another bug null-pointer-dereferencing a type while emitting a diagnostic.This PR resolves both the issue in the diagnostic emitting, as well as the underlying issue -- which was an un-necessary cast to
as Any.Type
which then would result in emitting an error diagnostic.Scope/Impact: Specifically actor systems which use Any as the serialization requirement. They would previously crash the compiler, and with this fix can work correctly.
Risk: Low, specific to Any using DistributedActorSystems. Has no impact on other types. The diagnostic fix just avoids null pointers.
Testing: Added test to exercise the problem.
Reviewed by: @xedin
Original PR: #84119
Radar: resolves rdar://159285863