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

Guard.IsReferenceEqualTo should accept T? #943

Open
4 tasks
AlgorithmsAreCool opened this issue Sep 8, 2024 · 0 comments
Open
4 tasks

Guard.IsReferenceEqualTo should accept T? #943

AlgorithmsAreCool opened this issue Sep 8, 2024 · 0 comments
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior

Comments

@AlgorithmsAreCool
Copy link

Describe the bug

Currently it seems that Guard.IsReferenceEqualTo requires the parameters to be non-null. I believe the signature should be changed to permit nullable types because I believe that comparison to null values is a reasonable expectation and it is supported by the underlying call to object.ReferenceEquals

Regression

No response

Steps to reproduce

object x = null;
object y = new Object();

Guard.IsReferenceEqualTo(x,y); //produces CS8634

Expected behavior

No CS8634

Screenshots

No response

IDE and version

VS 2022 Preview

IDE version

No response

Nuget packages

  • CommunityToolkit.Common
  • CommunityToolkit.Diagnostics
  • CommunityToolkit.HighPerformance
  • CommunityToolkit.Mvvm (aka MVVM Toolkit)

Nuget package version(s)

8.2.2

Additional context

No response

Help us help you

Yes, I'd like to be assigned to work on this item

@AlgorithmsAreCool AlgorithmsAreCool added the bug 🐛 An unexpected issue that highlights incorrect behavior label Sep 8, 2024
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
Projects
None yet
Development

No branches or pull requests

1 participant