Derek Parnell wrote:
I know that a better way to code this example would have been to use the .idup functionality, but that is not the point. I relied on the compiler ensuring that everything declared as immutable would not be modified. The compiler failed.
It is the same issue. When you use a cast, you are *explicitly* defeating the language's type checking ability. It means that the onus is on the one doing the cast to get it right.