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 F&O 15.5.6 (fn:collection) says "If $arg is the empty sequence, the function behaves as if it had been called without an argument" The static typing rules in FS 7.2.5 should reflect this. I suspect it should be something along the lines of: statEnv |- QName of func expands to (FN-URI,"collection") statEnv |- Implementation-defined default sequence has type Type statEnv |- Expr : empty-sequence() ------------------------------------------------------------------ statEnv |- QName(Expr) : Type
As I understand it, the rules of FS 7.2.5 are complete, and consistent with F+O 15.5.6, they just aren't as precise as they could be in the case where the argument's static type is empty. So unless that lack of precision causes serious problems, I don't think I can process this as an erratum. (Note that an implementation is free to infer the more precise type under FS 6.1.1 Static Typing Extensions.)
That's a shame. We do of course implement this rule. Might it be considered as a feature request for XQuery 1.1 FS? It seems unfortunate that fn:collection() and fn:collection( () ) should be typed differently when the behaviour is meant to be the same.
(In reply to comment #2) > Might it be considered as a feature request for XQuery 1.1 FS? Yes, I've marked it as "consider for 1.1" in the Status Whiteboard. > It seems unfortunate that fn:collection() and fn:collection( () ) should be > typed differently when the behaviour is meant to be the same. I agree, but I don't think "unfortunate" warrants an erratum.
Thanks. The only argument in favour of adding it as an erratum would be: "If $arg is the empty sequence, the function behaves as if it had been called without an argument." but I don't think I'd even try to argue that the static type is a part of the behaviour.
At their meeting today, the WGs approved the response in comment #1, so I am changing this issue's Severity to "enhancement" and marking it as resolved-WONTFIX (and keeping "consider for 1.1" in the Status Whiteboard). If you accept this resolution, please mark the issue CLOSED.
Thanks. I'd like to request that the static typing rules of fn:trace also be considered for 1.1 (Bug 3784).