<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>5786</bug_id>
          
          <creation_ts>2008-06-23 13:46:27 +0000</creation_ts>
          <short_desc>[FS] improve static typing of fn:trace()</short_desc>
          <delta_ts>2008-10-14 17:52:02 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Formal Semantics 3.0</component>
          <version>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>need to edit 1.1 doc</status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Liam R E Quin">liam</reporter>
          <assigned_to name="Michael Dyck">jmdyck</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>20747</commentid>
    <comment_count>0</comment_count>
    <who name="Liam R E Quin">liam</who>
    <bug_when>2008-06-23 13:46:27 +0000</bug_when>
    <thetext>See bug 3784 for details:

[[
Since the return type for fn:trace isn&apos;t inferred from the input it is tracing,
one must in most cases insert a &apos;treat as&apos; 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(&quot;this Input is traced&quot;, &quot;The trace message.&quot;) eq &quot;a string&quot;

because the left operand to &apos;eq&apos; 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.
]]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22169</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2008-10-14 17:52:02 +0000</bug_when>
    <thetext>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 &quot;similarly to
fn:reverse()&quot;, which is:

    --------------------------------------------------------------------
    statEnv |- (FN-URI,&quot;reverse&quot;)(Type) : prime(Type) · quantifier(Type)

but for fn:trace, it shouldn&apos;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 &lt;: xs:string
    -------------------------------------------------
    statEnv |- (FN-URI,&quot;trace&quot;)(Type1, Type2) : Type1

Given this decision, I am marking this issue resolved-fixed. (I&apos;m not sure
who should close it, Liam Quin or Frans Englich.)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>