This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
In the typechecking rules for fn:subsequence http://www.w3.org/TR/xquery-semantics/#sec_fn_subsequence we have: statEnv |- QName of func expands to (FN-URI,"subsequence") statEnv |- Expr : Type quantifier(Type) in { * } ------------------------------------------------------ statEnv |- QName(Expr, NumericLiteral, 1) : prime(Type) ? This can also include quantifier +. i.e. statEnv |- QName of func expands to (FN-URI,"subsequence") statEnv |- Expr : Type quantifier(Type) in { *, + } ------------------------------------------------------ statEnv |- QName(Expr, NumericLiteral, 1) : prime(Type) ? Similarly: statEnv |- QName of func expands to (FN-URI,"subsequence") statEnv |- Expr : Type quantifier(Type) in { *, + } ------------------------------------------------------ statEnv |- QName(Expr, $fs:last, 1) : prime(Type) ? and statEnv |- QName of func expands to (FN-URI,"subsequence") statEnv |- Expr : Type quantifier(Type) in { *, + } ------------------------------------------------------ statEnv |- QName(Expr, $fs:position, 1) : prime(Type) ? although in the case of +, the type of the last two could be deduced as Prime(Type)) (I think!)
Tim, Despite those rules having been checked by many people (See Bugs #2303, #1968, #1728), I believe you are right that we could and probably should cover '+' as well as '*'. I don't believe you could do better than prime(Type)? since + only guarantees there is at least one item. That said, I don't believe the rules are broken (in the sense of being inconsistent) so I am not sure what the working groups will want to reconsider this, considering the late stage of the process. - Jerome
Thanks. I think we added these rules to our implementation to prevent failing some of the XQTS tests due to static type failures.
Tim, The XSLT and XML Query working groups have considered your comment and decided to accept the suggested changes. Best, - Jerome On behalf of the XSLT and XML Query WGs