-
Notifications
You must be signed in to change notification settings - Fork 2k
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
F# Discriminative Unions not serializing correctly when being returned from grains #9258
Comments
This works as expected when targeting dotnet 8 |
@WesleySkeen does it work when targeting Orleans v9.0.1 with .NET 8.0? Could it be an internal representation breakage in F# 9.0? |
@ReubenBond I just checked there, updated all 'Microsoft.Orleans.*' packages int he solution to 9.0.1. Does not work. So your thought is correct I think |
Orleans v9.0.1 is compatible with .NET 8.0 and .NET 9.0 - does it work with 8 and not 9? This will need further investigation |
@ReubenBond apologies, here is a table of Orleans versions against dotnet versions and if it works or not. Looks like an issue with Orleans from this
The repo I linked can be used to do some tests if needed |
Hi, This is indeed an Orleans issue, but there is a known workaround. The reason for this is the change in the Orleans source generator introduced in #9095. There we go from serializing the public property
in
this would fail at compile time in the Orleans source generator. This is reported in issue #8717. I see now, @ReubenBond, that you answered me the same day I asked for where to document this 🙈 I will try to document this at the start of next year. Can we solve this somehow? The current approach using the Roslyn APIs for code analysis might not be the best fit for F#, since we rely on F# compiler implementation details when discovering what to generate serialization code for. I don't know what we could do instead. |
I believe there is an issue with the fsharp discrimitive unions and the orleans dotnet 9 grain serializer
Here is a repo were this can be reproduced
https://github.com/WesleySkeen/orleans-fsharp-dotnet9/tree/main
I have this type that gets returned from the grain
Here is the grain interface and its implementation
I have hardcoded the result to demonstrate the issue.
I believe the issue lies in the
responseCopier
of theGrainMethodInvoker
classHere is the response before the
responseCopier
function gets calledand here is the result after
As you can see, the content of the discrimitive union is now null
The text was updated successfully, but these errors were encountered: