-
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
UnsafeAccessor
throws MissingFieldException
on generic field (T
)
#92633
Comments
UnsafeAccessor
throws MissingFieldException
on generic array field (T[]
)UnsafeAccessor
throws MissingFieldException
on generic field (T
)
Tagging subscribers to this area: @dotnet/area-system-runtime-compilerservices Issue DetailsDescription
Reproduction Steps[UnsafeAccessor(UnsafeAccessorKind.Field, Name = "_items")]
static extern ref string[] GetItems(List<string> list);
GetItems(new()); Expected behaviorgetting field Actual behaviorthrows exception
Regression?No response Known WorkaroundsNo response Configuration.NET SDK: 8.0.100-rc.1.23455.8 Other informationNo response
|
Boo. For my original implementation of the signature match this worked. When I switched to the more robust, but stricter, built-in element compare this support was lost. Le sigh. There is little chance this sort of fix meets the servicing bar. I will take a little bit to try and make it work, but this is likely a .NET 9 fix. |
Yep, this is a future fix. If the Let me add some tests for this. |
With how this is currently implemented there is some overlap with #89439. The core issue being how we parse and compare signatures. |
I've added disabled tests in #92657 and fixed some issues with NAOT. |
I'm going to close this as duplicate since this work will be included in #89439. I've already got the static/instance fields working and have re-enabled the failing tests in my working branch. |
Description
UnsafeAccessor
throwsMissingFieldException
on generic field (T
) in generic type, where geneticT
is:class
(e.g.string
)struct
that hasclass
as a generic parameter (e.g.ArraySegment<string>
)Reproduction Steps
Expected behavior
getting field
Actual behavior
throws exception
Regression?
No response
Known Workarounds
No response
Configuration
.NET SDK: 8.0.100-rc.1.23455.8
Other information
No response
The text was updated successfully, but these errors were encountered: