<?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>4611</bug_id>
          
          <creation_ts>2007-06-08 17:57:15 +0000</creation_ts>
          <short_desc>[UPD] Better error specification for updating function with declared return type</short_desc>
          <delta_ts>2007-08-07 09:40:43 +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>Update Facility</component>
          <version>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="John Snelson">john.snelson</reporter>
          <assigned_to name="Andrew Eisenberg">andrew.eisenberg</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>15329</commentid>
    <comment_count>0</comment_count>
    <who name="John Snelson">john.snelson</who>
    <bug_when>2007-06-08 17:57:15 +0000</bug_when>
    <thetext>In section 2.5.6.2.a the XQuery Update specification states:

as SequenceType must not be specified because, in the current design, the XDM instance returned by an updating expression is always the empty sequence.

The EBNF grammar production for a function declaration is this:

[26] FunctionDecl ::= &quot;declare&quot; &quot;updating&quot;? &quot;function&quot; QName &quot;(&quot; ParamList? &quot;)&quot; (&quot;as&quot; SequenceType)? (EnclosedExpr | &quot;external&quot;)

Since the grammar production does not disallow the specifying of a return type, I believe we need to take one of two actions:

1) Specify an error code for the static error to be raised in the event of a return type being present.

2) Tighten the EBNF grammar production to disallow a return type when &quot;updating&quot; is used, thus including such a use under error [err:XPST0003]. This could be done by replacing grammar production 26 with the following:

[26] FunctionDecl ::= NonUpdatingFunctionDecl | UpdatingFunctionDecl

[26a] NonUpdatingFunctionDecl ::= &quot;declare&quot; &quot;function&quot; QName &quot;(&quot; ParamList? &quot;)&quot; (&quot;as&quot; SequenceType)? (EnclosedExpr | &quot;external&quot;)

[26b] UpdatingFunctionDecl ::= &quot;declare&quot; &quot;updating&quot; &quot;function&quot; QName &quot;(&quot; ParamList? &quot;)&quot; (EnclosedExpr | &quot;external&quot;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15940</commentid>
    <comment_count>1</comment_count>
    <who name="Don Chamberlin">chamberl</who>
    <bug_when>2007-07-26 23:37:04 +0000</bug_when>
    <thetext>John,
On June 28, 2007, the Query Working Group agreed to resolve this bug report by adding a new static error code, XUST0028, for the case when a function declaration specifies both &quot;updating&quot; and a return type. This change will appear in the next version of the Update specification. If you are satisfied with this resolution, please change the status of this bug report to &quot;Closed&quot;.
Regards,
Don Chamberlin (for the Query Working Group)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>