-
Notifications
You must be signed in to change notification settings - Fork 788
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# records in reference assembly (/ref folder) are missing properties except for the last record in file [regression with 7.0.100-rc.2.22477.23 SDK ] #14088
Comments
One thing rc2 has on by default is producing refassemblies for net7 projects, this might be it. We might want to roll it back until fully tested. |
A few more hints: When reading the properties of F# types via reflection, they are all there and public. |
WorkaroundTo overcome this, please disable generation of F# reference assemblies (is on by default). That is, put the following in the .fsproj. After that, the project builds and runs.
|
|
Will cover this, thanks for the tips @vzarytovskii |
The issue is curious at the IL gen level: It only occurs when I have records with equaly-named properties. Even the screenshot above makes this clear - I had three records, and it generated each prop three times for the very last record. |
Huh, that's interesting, wondering if it's because we don't take types into account when we decide how to generate them? |
@buvinghausen while we're investigating, setting ProduceReferenceAssembly msbuild property to false can be used as a workaround. Sorry for the inconvenience. |
Thank you @vzarytovskii & @T-Gro for looking into this and providing insights. I can confirm the workaround does indeed get the compile errors to go away and I can proceed with testing our stack on RC2. Cheers. |
The fix should be in the next released of 17.4 and .net7 |
Thanks @vzarytovskii glad it will make it into the .NET 7.0 RTM cycle! |
This was fixed and inserted to 6.0 and 7.0 |
After downloading and installing the latest 7.0.100-rc.2.22477.23 SDK I can no longer compile my C# libraries because if any code appears after the F# record declaration the compiler will throw a CS0117 error if you try to set a property on a CLIMutable record and/or a CS1061 error if you try to get any property on a record from C#.
Repro steps
Provide the steps required to reproduce the problem:
Clone here to speed up the repro
Expected behavior
Expect to be able to still use F# records in C# after F# code appears after them
Actual behavior
CS0117 if you attempt to set/initialize an F# record property where F# code appears after the record declaration
CS1061 if you attempt to get the value from an F# record property where F# code appears after the record declaration
Known workarounds
Related information
7.0.100-rc.2.22477.23 SDK on both Windows & Ubuntu
The text was updated successfully, but these errors were encountered: