fix issue 10646 - [ICE] when casting dynamic array/static array to class reference

http://d.puremagic.com/issues/show_bug.cgi?id=10646