Open Sergio0694 opened 2 hours ago
Tagging subscribers to this area: @dotnet/area-system-runtime-compilerservices See info in area-owners.md if you want to be subscribed.
@AaronRobinsonMSFT it seems the problem is the ref readonly
return. If I change it to just ref
, then it works on .NET 9 as well. I suppose I can use that as a workaround for now, but shouldn't that work too though? It was working fine on .NET 8, and it feels like it should? 🤔
It is possible this was fixed in https://github.com/dotnet/runtime/pull/109694. Can you check the nightly build?
Description
Spotted while porting my ComputeSharp samples to .NET 9 (see here). It seems that
[UnsafeAccessor]
is broken in .NET 9 when used to access unspeakable fields (captured primary constructor parameters being a common example).Reproduction Steps
Expected behavior
Should work as expected.
Actual behavior
https://github.com/Sergio0694/ComputeSharp/pull/871
Regression?
Yes. Works fine on .NET 8.
Known Workarounds
None that I can think of.
Configuration