<?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>2546</bug_id>
          
          <creation_ts>2005-11-21 21:11:15 +0000</creation_ts>
          <short_desc>[XQuery] Type constraints on module import</short_desc>
          <delta_ts>2006-02-14 01:02:08 +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>XQuery 1.0</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</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="Michael Kay">mike</reporter>
          <assigned_to name="Don Chamberlin">chamberl</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>7250</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2005-11-21 21:11:16 +0000</bug_when>
    <thetext>Section 4.11 says:

&lt;quote&gt;
It is a static error [err:XQST0036] to import a module if the importing module&apos;s
in-scope schema types do not include definitions for the schema type names that
appear in variable declarations, function parameters, or function returns found
in the imported module.
&lt;/quote&gt;

This constraint seems over-severe in relation to functions and variables that
are declared in the imported module but are not referenced in the importing
module. The rule as written means that when extra functions or variables are
added to an existing library module, an importing module may be invalidated even
though it has not changed and makes no reference to the new functions or
variables. For vendors of function libraries, this will create quite unnecessary
problems in keeping successive releases of the library module backwards
compatible with existing client code.

(This assumes that &quot;found in&quot; is to be interpreted as &quot;present in&quot;. One could
argue that the compiler doesn&apos;t find functions and variables unless it looks for
them, and that there&apos;s no requirement to look for functions and variables that
aren&apos;t referenced. But that seems to be wriggling.)

Proposed change: replace the quoted paragraph by:

&lt;quote&gt;
It is a static error [err:XQST0036] to import a module if the importing module&apos;s
in-scope schema types do not include definitions for the schema type names that
appear in the declarations of variables and functions (whether in an argument
type or return type) that are present in the imported module and are referenced
in the importing module.
&lt;/quote&gt;

Michael Kay</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>8252</commentid>
    <comment_count>1</comment_count>
    <who name="Don Chamberlin">chamberl</who>
    <bug_when>2006-02-14 01:01:43 +0000</bug_when>
    <thetext>Mike,
On 01 Feb 2006 the Query working group agreed to adopt your suggestion. It will 
be reflected in the next version of the XQuery language specification. Since 
you were present at the discussion, I have marked this Bugzilla entry as closed.
Regards,
Don Chamberlin (for the XQuery working group)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>