cast the result of an array accesed value. works with objects so far