dotnet / dotnet/roslynator

RCS1202 Avoid NullRef - Needs to be more strict

Open
#704 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
3.5k
Forks
294
Avg merge
2h 30m
Merged PRs (30d)
4

Description

**Steps to Reproduce**:
```csharp
interface Foo {
bool? Get();
}

class Bar {
void DoStuff(Foo foo) {
var x = foo.Get().Value;
}
}
```

**Actual Behavior**:
RCS1202 Avoid NullRef not triggered

**Expected Behavior**:
RCS1202 Avoid NullRef should be triggered

**Other**:
Think RCS1202 should be a warning by default.

Contributor guide

Open the contributing guide

Research direction

Start from the RCS1202 analyzer and its existing tests, then reproduce the nullable bool .Value case shown in the issue. Done means the diagnostic is reported for that case; the separate request to change the default severity should be treated as a distinct decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.