This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 1708 - [FS] (editorial) recommendation for static typing extensions
Summary: [FS] (editorial) recommendation for static typing extensions
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Formal Semantics 1.0 (show other bugs)
Version: Last Call drafts
Hardware: All All
: P4 normal
Target Milestone: ---
Assignee: Jerome Simeon
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
: 1709 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-07-18 07:22 UTC by Daniela Florescu
Modified: 2005-09-06 13:07 UTC (History)
0 users

See Also:


Attachments

Description Daniela Florescu 2005-07-18 07:22:30 UTC
In 6.1 Static Typing Extensions, the FS specification states the following:

"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."

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.
Comment 1 Paul Cotton 2005-07-20 00:35:55 UTC
*** Bug 1709 has been marked as a duplicate of this bug. ***
Comment 2 Jerome Simeon 2005-07-21 00:27:02 UTC
I believe we closed this bug yesterday at the Redmond F2F meeting, with no action.
- Jerome