W3C home > Mailing lists > Public > public-qt-comments@w3.org > January 2013

[Bug 20632] [XP 3.0] Transitivity of subtype relationships

From: <bugzilla@jessica.w3.org>
Date: Fri, 11 Jan 2013 10:03:49 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-20632-523-8UXup8ep3b@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=20632

--- Comment #1 from Michael Kay <mike@saxonica.com> ---
The relevant rules are these two:

1. Ai and Bi are AtomicOrUnionTypes, and derives-from(Ai, Bi) returns true.

2. Ai and Bi are both pure union types, and every type t in the transitive
membership of Ai is also in the transitive membership of Bi.

If we fix bug #20643, then the meaning of rule 1 changes, and
subtype(xs:integer, union(xs:decimal, xs:string)) becomes true. This fixes part
of the problem.

The other part of the problem is that union(a, b) should be a subtype of
union(A, B) if a is a subtype of A and b is a subtype of B. We can achieve this
by changing rule 2 to say:

2. Ai is a pure union type, and every type t in the transitive membership of Ai
satisfies subtype-itemType(t, Bi)

However, this has a side-effect which we may or may not consider desirable. The
side-effect is that (for example) union(dayTimeDuration, yearMonthDuration) is
now a subtype of duration, which was not the case before. Clearly it is both
safe and useful that this relation should hold, but it is definitely a change
in the spec. If we want to avoid introducing this side-effect, we could instead
write rule 2 as:

2. Ai and Bi are both pure union types, and every type t in the transitive
membership of Ai satisfies subtype-itemType(t, Bi)

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Friday, 11 January 2013 10:03:50 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 11 January 2013 10:03:50 GMT