Fix portable IsReferenceOrContainsReference<T> for pointer types #32
Labels
bug 🐛
An unexpected issue that highlights incorrect behavior
high-performance 🚂
Issues/PRs for the HighPerformance package
Projects
Overview
The
IsReferenceOrContainsReferences(Type)
method we use to polyfill on .NET Standard < 2.1 has a bug that was inherited from the portable implementation originally in the BCL, which causes pointer types or types containing pointer types to be reported as being reference types. This is caused byType.IsValueType
actually returningfalse
in this case (for... Reasons? 🤷).dotnet/CommunityToolkit.HighPerformance/Helpers/Internals/RuntimeHelpers.cs
Line 184 in 1a94430
There should be an additional check for pointer types, and also a workaround for
IsValueType
.The text was updated successfully, but these errors were encountered: