-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[NativeAOT] don't generate __GetFieldHelper if struct is never boxed? #111544
Labels
Milestone
Comments
dotnet-policy-service
bot
added
the
untriaged
New issue has not been triaged by the area owner
label
Jan 17, 2025
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
This is the repro, not great. var action = (Struct _) => { };
struct Struct; |
This is from two things:
Making it so that 1 or 2 doesn't apply would fix this. I don't know if it's really possible. We had reasons for both behaviors. |
jeffschwMSFT
removed
the
untriaged
New issue has not been triaged by the area owner
label
Jan 22, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm unsure how feasible this is but it would be helpful if the helper isn't emitted if the struct is never boxed (and never gets a constrained call on Equals/GetHashCode either).
I understand the difficulty of tracking whether a struct is 'boxed', as generics (and
(T)(object)value
casts etc) significantly complicate the analysis. Though with struct types forcing specialization it should not be impossible to get some certainty?The text was updated successfully, but these errors were encountered: