dotnet / dotnet/vblang

null-conditional for boolean operation should be typed to nullable

Open
#624 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
328
Forks
71
PR merge metrics
No merged PRs in 30d

Description

The Null Conditional operator when used in conjunction with a boolean function should result in a nullable value and not require parentheses around it before checking GetValueOrDefault or HasValue

```
Dim ids As List(Of Integer) = Nothing
If Not ids?.Any() Then
End If
```
vs
```
Dim ids As List(Of Integer) = Nothing
If Not (ids?.Any()).GetValueOrDefault Then
End If
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.