Fix not to expand cast to anonymous type