RCS1220 Use pattern matching instead of is+as?
Open
Area-Analyzers
Feature Request
- Dominant language
- C#
- Stars
- 3.5k
- Forks
- 294
- Avg merge
- 2h 30m
- Merged PRs (30d)
- 4
Description
An is+cast operator gets flagged by RCS1220. Should is+as also be flagged to be replaced by pattern matching?
```csharp
void Method(Control control)
{
//is+cast operator
if (control is TextBox)
{
TextBox textbox = (TextBox)control;
}
//is+as
if (control is TextBox)
{
TextBox textbox = control as TextBox;
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.