Skip to content

changed function error code for external function processing#101

Open
lor1113 wants to merge 1 commit intosissaschool:masterfrom
lor1113:master
Open

changed function error code for external function processing#101
lor1113 wants to merge 1 commit intosissaschool:masterfrom
lor1113:master

Conversation

@lor1113
Copy link
Copy Markdown
Contributor

@lor1113 lor1113 commented Apr 5, 2026

I am running a test suite and found that it expects error XPTY0004 in a situation where a custom function is passed an invalid type (it expects element(x:a) as defined in the function signature, is instead passed element(x:b)). Elementpath as currently written raises XPDY0050. Looking into the underlying spec, XPTY0004 does seem like the correct error for this case. The spec defines that

If, after the above conversions, the resulting value does not match the expected type according to the rules for SequenceType Matching, a type error is raised [err:XPTY0004]. Note that the rules for SequenceType Matching permit a value of a derived type to be substituted for a value of its base type.

Meanwhile the error definition for XPDY0050 defines it as a failure of a treat expression, which does not seem to be relevant to this situation.

Very quick PR to substitute the error codes in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant