This PR simplifies the logic of encode_action_body and fixes a bug with
the encoding of tagged custom types (which map to C# value types) in Slice1 mode (quite niche).
Notably, this calls EncodeNullableCustomType which is incorrect. We know here that value is non-null.
Even the type of the lambda is MyCustomType, with no ? suffix.
This PR fixes this to call the non-nullable function:
Part of this PR got spun off into #3916.
So, to save hassle on merge conflicts, I'm going to wait to merge this PR until that one, since this PR will be much simpler to fix the conflicts on.
This PR simplifies the logic of
encode_action_body
and fixes a bug with the encoding of tagged custom types (which map to C# value types) in Slice1 mode (quite niche).For example, take this snippet:
We currently generate this:
Notably, this calls
EncodeNullableCustomType
which is incorrect. We know here thatvalue
is non-null. Even the type of the lambda isMyCustomType
, with no?
suffix.This PR fixes this to call the non-nullable function: