partially fixed TypeResolver and CodeGen to support array resize