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

RCS1248 triggers when used in expression trees, but pattern-matching 'is' operator cannot be used in expression trees #901

Closed
riley-van-hengstum opened this issue May 23, 2022 · 0 comments
Assignees

Comments

@riley-van-hengstum
Copy link

riley-van-hengstum commented May 23, 2022

Product and Version Used:
4.1.0

Steps to Reproduce:

roslynator_null_check_style = pattern_matching
dotnet_diagnostic.RCS1248.severity = suggestion # "Normalize null check"

Actual Behavior:

var users = dbContext.Users
    .Where(user => user.Address != null) // <-- RCS1248 triggers here
    .ToList();

(using Queryable.Where)

Expected Behavior:
RCS1248 doesn't trigger when used in expression tree.

@josefpihrt josefpihrt self-assigned this May 25, 2022
Haarmees pushed a commit to Haarmees/Roslynator that referenced this issue Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants