I'm looking at a function with this pattern:

```
if( obj is SpecificClass1 )
{
   ((SpecificClass1)obj).SomeMethod1();
}
else if( obj is SpecificClass2 )
{
   ((SpecificClass2)obj).SomeMethod2();
}
else if( obj is SpecificClass3 )
{
   ((SpecificClass3)obj).SomeMethod3();
}

```

and get a Code Performance Analysis Warning: CA1800 Do not cast unnecessarily.

Why do the double casts (using the 'is' operator in the if expression and the parenthesis style cast in the body of each if) not get optimized away by the compiler. I can't see why this would be a performance problem the compiler can't solve.