IntelliTect / IntelliTect/CodingGuidelines
Add analyzer that flags var in pattern matching
Offen
enhancement
- Vorherrschende Sprache
- C#
- Sterne
- 12
- Forks
- 16
- Ø Merge
- 2 Min.
- Gemergte PRs (30 T.)
- 7
Beschreibung
Based on internal discussion.
Pattern matching with var provides little value since it effectively matches everything and ends up copying to a local value.
Match on this
```
if ( bar is var foo )
```
Suggested code change (just to help educate people)
```
var foo = bar;
if ( true )
```
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.