Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements/fixes for the coercion rules #254

Merged
merged 1 commit into from
Nov 29, 2022

Conversation

michaelhkay
Copy link
Contributor

@michaelhkay michaelhkay commented Nov 17, 2022

This PR is concerned with the coercion rules (formerly known as function conversion rules).

It fixes issue #242, a minor omission where we failed to say that coercion rules are used to convert the result of a static function call to the required return type.

It implements the proposal in issue #189, to apply the coercion rules to variable declarations/bindings as well as to function arguments and results. This brings XQuery into line with XSLT, and thus paves the way to allowing type declarations on "let" clauses in XPath.

It does some further editorial tidying up of the rules, such as improvng the definition of the term "coercion rules", adding clarifying notes, etc.

In approving this PR, I am requesting approval of the change (which was already in the draft, but has not been discussed) to introduce "down-casting" or "relabelling". This allows a function to declare a parameter with required type xs:positiveInteger, and for a caller to supply the value 42 without explicitly casting it to xs:positiveInteger.

@ndw
Copy link
Contributor

ndw commented Nov 29, 2022

Accepted at meeting 013

@ndw ndw merged commit eb07b2c into qt4cg:master Nov 29, 2022
@michaelhkay michaelhkay deleted the Issue242-coercion branch July 9, 2023 23:29
@michaelhkay michaelhkay added Completed PR has been applied, tests written and tagged, no further action needed Tests Added Tests have been added to the test suites labels Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Completed PR has been applied, tests written and tagged, no further action needed Tests Added Tests have been added to the test suites
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants