<?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>1709</bug_id>
          
          <creation_ts>2005-07-18 07:23:47 +0000</creation_ts>
          <short_desc>[FS] (editorial) recommendation for static typing extensions</short_desc>
          <delta_ts>2005-09-06 13:07:20 +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 1.0</component>
          <version>Last Call drafts</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>1708</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P4</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Daniela Florescu">dflorescu</reporter>
          <assigned_to name="Jerome Simeon">simeon</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>4795</commentid>
    <comment_count>0</comment_count>
    <who name="Daniela Florescu">dflorescu</who>
    <bug_when>2005-07-18 07:23:47 +0000</bug_when>
    <thetext>In 6.1 Static Typing Extensions, the FS specification states the following:

&quot;It is not recommended for a static typing extension to change the
static typing behavior of expressions that specify a type explicitely
 (treat as, cast as, typeswitch, function parameters, and type
declarations in variable bindings), since the purpose of those 
expressions is to impose a specific type.&quot;

This kind of recommendation is not appropriate for a standard specification.
In fact, many desirable static typing extensions will violate this recommendation.
This is likely to happen if the specified type is a supertype of the static type result. 

Consider the following example:

declare function local:f($x as xs:decimal) as item* {$x};
local:f(3)+4

The static type analysis can infer that the function retun type is
xs:decimal, which is more specific than item*. So an implementation 
may correctly infer xs:decimal as the static type of local:f() 
such that that the subsequent static type analysis of addition will be OK. 
Otherwise, this query will  unnecessarily yield pessimestic type errors.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4802</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Rys">mrys</who>
    <bug_when>2005-07-18 09:54:14 +0000</bug_when>
    <thetext>You may be correct for most of the given expressions. But note that a treat as 
has the explicit purpose to set the static type...

Michael (personal response)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4962</commentid>
    <comment_count>2</comment_count>
    <who name="Paul Cotton">pcotton</who>
    <bug_when>2005-07-20 00:35:55 +0000</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of 1708 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>