changed function error code for external function processing#101
Open
lor1113 wants to merge 1 commit intosissaschool:masterfrom
Open
changed function error code for external function processing#101lor1113 wants to merge 1 commit intosissaschool:masterfrom
lor1113 wants to merge 1 commit intosissaschool:masterfrom
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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
treatexpression, which does not seem to be relevant to this situation.Very quick PR to substitute the error codes in this case.