-
Notifications
You must be signed in to change notification settings - Fork 830
[<Struct>] DUs - eliminate dummy .ctor args, fix bug > 49 cases, simplify IL #15695
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
Conversation
|
Important question - do we merge it, so it gets to 8, or is it too risky? |
|
For me the risk outweighs the existing error A downside is that we are not dogfooding large struct DUs ourselves that much, only a few small ones in FSharp.Core. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I guess this can go?
Fixes: #5342
Fixes: #9767
Before:
https://sharplab.io/#v2:DYLgZgzgPgsAUAbQDwDkD2BhNBbADgQwCcBLCNAOwG50BRARwFd9hiAXAT0oGVXCGBjVgD4AuvA64ApgAIAKhAjSAvNOkBBaVGkAhTdIx6AInpp6AYnoDiegBJ6AknoBSegNJ6AMnoCyelPHggA=
Have a look at the generated constructors, artificial arguments were added to tell them apart.
This lead to unexpected runtime crashes when constructing a case from a DU with > 49 cases.
After:
new StructType(_tag = 13))The public-API - mainly properties for creationg, "IsXXX" properties etc. all remain the same, as does the struct layout in memory (at least for this PR).