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

Remove class constraint from Guard.Is[Not]Null APIs #78

Merged
merged 2 commits into from
Jan 4, 2022

Conversation

Sergio0694
Copy link
Member

Closes #43

This PR removes the where T : class constraint from the Guard.Is[Not]Null APIs.

API diff

 namespace CommunityToolkit.Diagnostics;

 public static class Guard
 {
     public static void IsNull<T>(T? value, [CallerArgumentExpression("value")] string name = "")
-        where T : class

     public static void IsNotNull<T>([NotNull] T? value, [CallerArgumentExpression("value")] string name = "")
-        where T : class
 }

@Sergio0694 Sergio0694 added improvements ✨ Improvements to an existing functionality next preview ✈️ This changes will be available in the upcoming preview diagnostics 🔬 Issues/PRs for the Diagnostics package labels Jan 1, 2022
@Sergio0694 Sergio0694 force-pushed the dev/guard-unconstrained-generic branch from ad9c2f7 to c096438 Compare January 4, 2022 12:25
@Sergio0694 Sergio0694 merged commit 0e150d5 into main Jan 4, 2022
@delete-merged-branch delete-merged-branch bot deleted the dev/guard-unconstrained-generic branch January 4, 2022 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diagnostics 🔬 Issues/PRs for the Diagnostics package improvements ✨ Improvements to an existing functionality next preview ✈️ This changes will be available in the upcoming preview
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Guard: Constrained generic type to class/struct prevent any unconstraint use.
2 participants