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 1964 - [FS] technical: 5.14 Variable Declaration: missing type-check
Summary: [FS] technical: 5.14 Variable Declaration: missing type-check
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
: P2 normal
Target Milestone: ---
Assignee: Jerome Simeon
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-02 00:24 UTC by Michael Dyck
Modified: 2005-09-27 08:31 UTC (History)
0 users

See Also:


Attachments

Description Michael Dyck 2005-09-02 00:24:51 UTC
5.14 Variable Declaration

SCP / rule 2
    XQuery 4.14 says "If a variable declaration includes both a type and
    an expression, the value returned by the expression must match the
    declared type...". Thus, this rule should have something like
        statEnv |- Expr : Type2
        Type2 <: Type
    This will presumably involve splitting the rule into two, since the
    conclusion's "(:= Expr | external)" doesn't always provide a binding
    for Expr.
Comment 1 Jerome Simeon 2005-09-06 15:36:36 UTC
Yes!

I thought I remember it was the way it was done. That's a good catch.

We should have the following two rules:

statEnv |- VarRef of var expands to Variable
statEnv |- Type = [SequenceType]sequencetype
statEnv1 = statEnv + varType( Variable => Type)
---------------------------------------------------------------------------
statEnv |- declare variable VarRef as SequenceType external =>stat statEnv2

statEnv |- VarRef of var expands to Variable
statEnv |- Type = [SequenceType]sequencetype
statEnv |- Expr : Type2
statEnv |- Type2 <: Type
statEnv1 = statEnv + varType( Variable => Type)
--------------------------------------------------------------------------
statEnv |- declare variable VarRef as SequenceType := Expr =>stat statEnv2

- Jerome
Comment 2 Jerome Simeon 2005-09-27 08:31:08 UTC
The XSLT and XML Query Working Groups have accepted your comment and the
proposed resolution.
Best,
- Jerome