dotnet / dotnet/vblang

[Proposal] Less verbose null checks

Open
#578 16 comments 1 reaction 0 assignees View on GitHub
Dominant language
No language data
Stars
328
Forks
71
PR merge metrics
No merged PRs in 30d

Description

Can't we writ this statement:
```VB.NET
If pop IsNot Nothing Then pop.IsOpen = False
```

just as:
```VB.NET
pop?.IsOpen = False
```

Or at least:
```VB.NET
If pop Then pop.IsOpen = False
```

I am using `option strict of`, so, again, why can't an object converted to a Boolean in a condition context?

Or at least:
```VB.NET
If pop? Then pop.IsOpen = False
```

and of course, I prefer `pop?.IsOpen = False` the most.

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.