IntelliTect / IntelliTect/CodingGuidelines

Add analyzer that flags var in pattern matching

未关闭
#52 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
C#
星标
12
派生
16
平均合并
2 分钟
30 天内合并 PR
7

描述

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 )
```

贡献指南

打开贡献指南

调研方向

No files, tests, or analyzer entry points are named in the issue. First locate the repository's analyzer implementation and test layout, then use the var-in-pattern example as the reproduction; done means the analyzer flags this pattern and the behavior is covered by tests.

由索引模型根据 Issue 内容生成。

评估

技术栈
csharp
领域
tooling
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。