[Generator] Remove redundant cast.