This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
See bug 3784 for details: [[ Since the return type for fn:trace isn't inferred from the input it is tracing, one must in most cases insert a 'treat as' expression each time one inserts an fn:trace call. I would find this very cumbersome. For example, this query is a static typing error: trace("this Input is traced", "The trace message.") eq "a string" because the left operand to 'eq' has item()* as static type. I suggest that a section is added for fn:trace, and that its return type is inferred similarly to fn:reverse(). This is a large change, but the specification also has a large hole here, in my opinion. fn:trace() is very unpractical on a static typing implementation as it is now. ]]
At their meeting today, the WGs approved the request for FS 1.1 to provide a specific static typing rule for calls to fn:trace. The original submission suggested that the type be inferred "similarly to fn:reverse()", which is: -------------------------------------------------------------------- statEnv |- (FN-URI,"reverse")(Type) : prime(Type) ยท quantifier(Type) but for fn:trace, it shouldn't be necessary to factor the type. The static type of the call can simply be the static type of the first argument. That is: Type2 <: xs:string ------------------------------------------------- statEnv |- (FN-URI,"trace")(Type1, Type2) : Type1 Given this decision, I am marking this issue resolved-fixed. (I'm not sure who should close it, Liam Quin or Frans Englich.)