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

Proposal: Duplicate null check analyzer #3029

sharwell opened this issue Nov 9, 2019 · 0 comments


Copy link

@sharwell sharwell commented Nov 9, 2019

Observed in dotnet/roslyn#39738 (comment).

The following code contains a duplicate null check, as the pattern itself contains a null check.

Debug.Assert(value != null);
Debug.Assert(value is { Property: 0 });

The proposed analyzer would highlight the first call to Debug.Assert as unnecessary (redundant).

@sharwell sharwell transferred this issue from dotnet/roslyn Nov 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.