IntelliTect / IntelliTect/CodingGuidelines

Add analyzer that flags var in pattern matching

Đang mở
#52 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
C#
Star
12
Fork
16
Merge trung bình
2 phút
Pull request đã merge (30 ngày)
7

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.