Skip to content
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

Fix portable IsReferenceOrContainsReference<T> for pointer types #32

Closed
Sergio0694 opened this issue Nov 15, 2021 · 0 comments · Fixed by #65
Closed

Fix portable IsReferenceOrContainsReference<T> for pointer types #32

Sergio0694 opened this issue Nov 15, 2021 · 0 comments · Fixed by #65
Assignees
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior high-performance 🚂 Issues/PRs for the HighPerformance package
Projects

Comments

@Sergio0694
Copy link
Member

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 by Type.IsValueType actually returning false in this case (for... Reasons? 🤷).

private static bool IsReferenceOrContainsReferences(Type type)

There should be an additional check for pointer types, and also a workaround for IsValueType.

@Sergio0694 Sergio0694 added bug 🐛 An unexpected issue that highlights incorrect behavior high-performance 🚂 Issues/PRs for the HighPerformance package labels Nov 15, 2021
@Sergio0694 Sergio0694 self-assigned this Nov 15, 2021
@Sergio0694 Sergio0694 added this to To do in 8.0 Nov 15, 2021
@Sergio0694 Sergio0694 moved this from To do to In progress in 8.0 Dec 17, 2021
8.0 automation moved this from In progress to Done Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior high-performance 🚂 Issues/PRs for the HighPerformance package
Projects
No open projects
8.0
Done
Development

Successfully merging a pull request may close this issue.

1 participant