IntelliTect / IntelliTect/CodingGuidelines
Add analyzer that flags var in pattern matching
Ouverte
enhancement
- Langage dominant
- C#
- Étoiles
- 12
- Forks
- 16
- Merge moyen
- 2 min
- PR mergées (30 j)
- 7
Description
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 )
```
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.