dotnet / dotnet/msbuild

Warn for conditional clauses that are either always true or never true

Open
#6,277 8 comments 4 reactions 0 assignees View on GitHub
bug triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

The below was a typo we overlooked in our repo. Strictly, the expression is "valid" but the possibility it was intended is zero.

Have you considered warning for conditions or clauses in conditions that will either ALWAYS or NEVER be true? In this case, it will always be true. I am guessing such clauses are very rarely intentional.

```xml

```

```
C:\proj\1>dotnet --version
6.0.100-preview.2.21155.3

C:\proj\1>dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.100-preview.2.21155.3
Commit: 1a9103db2d

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19042
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.100-preview.2.21155.3\

Host (useful for support):
Version: 6.0.0-preview.2.21154.6
Commit: 3eaf1f316b

...
```

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.