Can you set the right cast so static analysis doesn't complain?