-
Notifications
You must be signed in to change notification settings - Fork 5k
[STJ] Account for F# CompilationMappingAttribute now supporting multiple declarations. #114961
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
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.
Pull Request Overview
This PR updates how the code retrieves the FSharp compilation mapping attributes to support multiple attribute declarations for .NET 10.
- In GetFSharpCompilationMappingAttribute, the code now retrieves all attributes and returns the first explicit declaration.
- In GetFSharpCoreAssembly, the attribute lookup is modified to ignore inherited attributes.
Files not reviewed (1)
- src/libraries/System.Text.Json/tests/System.Text.Json.FSharp.Tests/RecordTests.fs: Language not supported
Comments suppressed due to low confidence (2)
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/FSharpCoreReflectionProxy.cs:208
- Switching from GetCustomAttribute with inherit:true to retrieving all attributes with inherit:false and using the first one might overlook multiple explicit declarations. Please verify that only the first attribute is sufficient for the intended behavior.
object[] attributes = type.GetCustomAttributes(_compilationMappingAttributeType, inherit: false);
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/FSharpCoreReflectionProxy.cs:218
- Changing the attribute lookup from inherit:true to inherit:false might omit inherited attributes that could be relevant. Confirm that this adjustment aligns with the intended F# core assembly resolution behavior.
foreach (Attribute attr in type.GetCustomAttributes(inherit: false))
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis |
When you say, "Partially addresses," do you mean that it only addresses the issue for .NET 10, or do you mean that there are scenarios in .NET 10 still not addressed with this as well? |
I sorry, I should have said this addresses it fully for 10, but it shouldn't be used to close the underlying issue as we're working out resolution strategies for .NET 8 and 9. |
...es/System.Text.Json/src/System/Text/Json/Serialization/Metadata/FSharpCoreReflectionProxy.cs
Show resolved
Hide resolved
/ba-g The failures are all known and unrelated and they are not transient. |
/backport to release/9.0-staging |
Started backporting to release/9.0-staging: https://github.com/dotnet/runtime/actions/runs/14681001692 |
/backport to release/8.0-staging |
Started backporting to release/8.0-staging: https://github.com/dotnet/runtime/actions/runs/14681004374 |
Addresses #114824 for .NET 10.