add type inference to generator and some stmt