Skip to content
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

Bugfix:: Add missing codegen for mapping of overlapped struct DU fields and read it in fslib reflection #18274

Conversation

T-Gro
Copy link
Member

@T-Gro T-Gro commented Jan 27, 2025

Fixes #18121

To apply this fix, BOTH constellations will be needed:

  • compile the DU with fresh compiler (incl. this change)
  • at runtime, the program MUST have latest FSharp.Core (the one incl. this change)

An intermediáte library can be compiled against a lower fslib if the application uses fresh one at runtime.

Attributes coming for structs with field reuse compiled after this change WILL fail with Multiple CompilationMappingAttributes, expected at most one if they are consumed by reflection with an older FSharp.Core version.
Explicit exception is thrown in order to prevent incorrect results (=this is what the existing bug causes).

…y-array-for-non-first-cases-of-struct-unions-with-shared-fields
@T-Gro T-Gro marked this pull request as ready for review February 3, 2025 10:51
@T-Gro T-Gro requested a review from a team as a code owner February 3, 2025 10:51
@dotnet dotnet deleted a comment from github-actions bot Feb 3, 2025
@dotnet dotnet deleted a comment from github-actions bot Feb 3, 2025
Copy link
Contributor

github-actions bot commented Feb 3, 2025

❗ Release notes required


✅ Found changes and release notes in following paths:

Warning

No PR link found in some release notes, please consider adding it.

Change path Release notes path Description
src/FSharp.Core docs/release-notes/.FSharp.Core/9.0.300.md No current pull request URL (#18274) found, please consider adding it
src/Compiler docs/release-notes/.FSharp.Compiler.Service/9.0.300.md No current pull request URL (#18274) found, please consider adding it

@T-Gro T-Gro merged commit adb02dc into main Feb 4, 2025
33 checks passed
@T-Gro T-Gro deleted the 18121-fsharpvaluegetunionfields-returns-empty-array-for-non-first-cases-of-struct-unions-with-shared-fields branch February 4, 2025 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

FSharpValue.GetUnionFields returns empty array for non-first cases of struct unions with shared fields
4 participants