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