Originally defined in #81741, Generic support in UnsafeAccessorAttribute scenarios was not added. This issue tracks that effort across the runtimes.
For bound generic parameters this was originally thought to work but was broken after the final signature validation logic was implemented. This was reported in #92633 as a regression. That issue has been subsequently closed and folded into this work to support Generics on bound parameters too.
[UnsafeAccessor(UnsafeAccessorKind.Field, Name="_myList")]
static extern ref List<string> StringField(MyClass<string> _this);
[UnsafeAccessor(UnsafeAccessorKind.Field, Name="_myList")]
static extern ref List<double> DoubleField(MyClass<double> _this);
Example with unbound generic parameters.
[UnsafeAccessor(UnsafeAccessorKind.Field, Name="_myList")]
static extern ref List<T> Field<T>(MyClass<T> _this);
Originally defined in #81741, Generic support in
UnsafeAccessorAttributescenarios was not added. This issue tracks that effort across the runtimes.UnsafeAccessorAttributesupports generic parameters #99468UnsafeAccessorAttributesupports generic parameters #99468UnsafeAccessorAttribute#99830UnsafeAccessorAttribute- Add examples for generic support. dotnet-api-docs#9746For bound generic parameters this was originally thought to work but was broken after the final signature validation logic was implemented. This was reported in #92633 as a regression. That issue has been subsequently closed and folded into this work to support Generics on bound parameters too.
Example with unbound generic parameters.