You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add support for types xs:dateTimeStamp and xs:error - #2550
This PR adds implementations for the types xs:dateTimeStamp and xs:error.
The implementation of xs:error shares similarities with the earlier proposal to introduce a none type in #2160. However, unlike that proposal, xs:error is implemented as an atomic type, allowing us to reuse most of the existing infrastructure and simplifying the overall implementation.
The original motivation for #2160 was to improve tail-call optimization by disregarding the result type of fn:error, and this benefit is still achievable with the current approach (see the new test case TCOTest.typeCheckOnFnError). However, since the declared return type of fn:error has since been generalized to item()*, it is now necessary to explicitly use cast as xs:error in order to take advantage of this optimization.
However, since the declared return type of fn:error has since been generalized to item()*, it is now necessary to explicitly use cast as xs:error in order to take advantage of this optimization.
Perhaps we should suggest changing the return type to xs:error. What do you think?
Perhaps we should suggest changing the return type to xs:error. What do you think?
In fact I was expecting that, and I think we should. This would also align with what the spec says in 3.2.10. The type xs:error:
The practical uses of xs:error as a sequence type are limited, but they do exist. For instance, an error-handling function that always raises a dynamic error never returns a value, so xs:error is a good choice for the return type of the function.
A number of QT4 test cases would fail when the signature is changed with the implementation in this PR, those would need to be adapted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds implementations for the types
xs:dateTimeStampandxs:error.The implementation of
xs:errorshares similarities with the earlier proposal to introduce anonetype in #2160. However, unlike that proposal,xs:erroris implemented as an atomic type, allowing us to reuse most of the existing infrastructure and simplifying the overall implementation.The original motivation for #2160 was to improve tail-call optimization by disregarding the result type of
fn:error, and this benefit is still achievable with the current approach (see the new test caseTCOTest.typeCheckOnFnError). However, since the declared return type offn:errorhas since been generalized toitem()*, it is now necessary to explicitly usecast as xs:errorin order to take advantage of this optimization.