Project

Profile

Help

Bug #3905

Incorrect casting of xs:untypedAtomic in XDMString.compareTo()

Added by John Lumley about 1 year ago. Updated about 1 year ago.

Status:
Resolved
Priority:
Normal
Assignee:
Sprint/Milestone:
-
Start date:
2018-09-15
Due date:
% Done:

0%

Applies to JS Branch:
1.0, Trunk
Fix Committed on JS Branch:
Fixed in JS Release:
SEF Generated with:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

In Atomic.js 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

array:sort([xs:untypedAtomic('2015-06-12+01:00'),current-date()]

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.

History

#1 Updated by John Lumley about 1 year ago

  • Applies to JS Branch 1.0, Trunk added

Please register to edit this issue

Also available in: Atom PDF Tracking page