Incorrect casting of xs:untypedAtomic in XDMString.compareTo()
XDMString.compareTo() casts strings that are untypedAtomic to the other operand type. This is in line with the semantics of General Comparisons for operators such as <. However, evaluation of
gc already performs that action in such cases and resolution of
vc precasts an untypedAtomic to a string, so this operation should be unnecessary.
QT3 test sort-array-025 fails because in
the comparison uses the XDMString.compareTo(xs:date) and hence incorrectly casts the string to
xs:date, avoiding the incomparability error check, as would
fn:sort() in such circumstances. Thus the cast in XDMString.compareTo must not perform that cast. As far as I can see all necessary GeneralComparisons or ValueComparisons do necessary precasting.
Please register to edit this issue