the condition `dim == 0` is always `false` in this case.