diff --git a/src/arith/mod.rs b/src/arith/mod.rs index 4426dc38f..7e77df60d 100644 --- a/src/arith/mod.rs +++ b/src/arith/mod.rs @@ -450,8 +450,9 @@ macro_rules! arith_assign_func { #[allow(unused_variables)] fn $fn_name(&mut self, rhs: Array) { let mut idxrs = Indexer::new(); - idxrs.set_index(&Seq::::default(), 0, Some(false)); - idxrs.set_index(&Seq::::default(), 1, Some(false)); + for n in 0..self.numdims() { + idxrs.set_index(&Seq::::default(), n, Some(false)); + } let tmp = assign_gen(self as &Array, &idxrs, & $func(self as &Array, &rhs, false)); mem::replace(self, tmp);