In the array1.spad file the following is defined
shrink(r, i) ==
r.logLen := r.logLen - i
negative?(n := r.logLen) => error "internal bug in flexible array"
2*n+2 > r.physLen => r
not shrinkable? => r
if n < r.logLen then error "cannot shrink flexible array to indicated size"
n = 0 => empty()
r.physLen := n
y := newa(n::N, a := r.f)
for k in 0 .. n-1 repeat y.k := a.k
r.f := y
r
The line starting with
if n < r.logLen
can never be executed as the previous definition for n has already set this value to r.logLen.
I can, if anyone is interested, create a pull request to remove this specific line from the definition.
Hill Strong