<!DOCTYPE qhelp PUBLIC
  "-//Semmle//qhelp//EN"
  "qhelp.dtd">
<qhelp>
<overview>
<p>Some casts between array types are guaranteed to fail at runtime: the cast from Object[] to String[] will always fail, even if all the elements of the array are strings. Casts identified by this check either fail immediately, or (in the case of arrays with parameterized types) cause an InvalidCastException later on in the code.</p>

</overview>
<recommendation>
<p>Change the array creation expression to construct an array object of the right type.</p>

</recommendation>
<example>
<sample src="ImpossibleArrayCast.cs" />
</example>
</qhelp>
