W3C home > Mailing lists > Public > public-qt-comments@w3.org > May 2016

[Bug 29619] New: [FO31] Casting to abstract types

From: <bugzilla@jessica.w3.org>
Date: Sun, 08 May 2016 14:11:08 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-29619-523@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=29619

            Bug ID: 29619
           Summary: [FO31] Casting to abstract types
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators 3.1
          Assignee: mike@saxonica.com
          Reporter: abel.braaksma@xs4all.nl
        QA Contact: public-qt-comments@w3.org
  Target Milestone: ---

Common sense seems to dictate that casting to abstract types is not allowed.
However, the only hint I could find is in places where the text mentions that
casting to xs:NOTATION is not allowed *because* it is an abstract type.

The closest I got was in 19.3.2, which says:

"It is always possible to cast an atomic value A to a type T if the relation A
instance of T is true, provided that T is not an abstract type." 

However, this indicates that casting is *not always possible*. It doesn't
(necessarily) say that casting to a parent that is abstract is *always* a
failure.

Furthermore, sections 19.3.3 and 19.3.4 do not mention abstract types at all
(and I'm unsure the text there covers TT of abstract type).

Unless I am misunderstanding these sections, I propose to add a (tiny) section
under 19.3, something like:

19.3.1 Casting to abstract types
If TT is an abstract type, casting always fails. It doesn't matter in this case
if TT is a parent type of ST, or if TT is equal to ST.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Sunday, 8 May 2016 14:13:03 UTC

This archive was generated by hypermail 2.3.1 : Sunday, 8 May 2016 14:13:04 UTC