#750 Optimization causing type error in remove()

v8.9
closed
nobody
None
5
2012-10-08
2007-12-11
Michael Kay
No

An expression of the form SEQ[position() ne $X] is rewritten to use the remove() function - essentially remove(SEQ, if (isWholeNumber($X)) then $X else 0)

Unfortunately this rewrite fails in the case where $X is not an integer, on the grounds that remove() requires the second argument to be an integer. The error message refers to a type error in the second argument of remove(), without giving the location of the error.

A patch is being placed in Subversion. As a workaround, declare the types of your variables to be integers if they actually are integers!

Discussion

  • Michael Kay
    Michael Kay
    2008-08-06

    Logged In: YES
    user_id=251681
    Originator: YES

    As far as I am aware this problem was fixed some time in the past and I am assuming that the bug should have been closed.