[chatter] [Bug 7377] New: subtype? doesn't work with limited collections in type-union
bugzilla-daemon at lovelace.opendylan.org
bugzilla-daemon at lovelace.opendylan.org
Sat May 10 03:08:46 CEST 2008
http://www.opendylan.org/cgi-bin/bugzilla/show_bug.cgi?id=7377
Summary: subtype? doesn't work with limited collections in type-
union
Product: OpenDylan
Version: OD 1.0 beta 4
Platform: PC
OS/Version: Mac OS
Status: NEW
Severity: normal
Priority: P2
Component: Compiler/General
AssignedTo: d_j_v at mac.com
ReportedBy: d_j_v at mac.com
CC: chatter at lists.opendylan.org
On the subject of union types, the DRM says (p 73,
http://www.opendylan.org/books/drm/Union_Types):
"subtype?(s1, type-union*(t1...tn)) will be true if and only if subtype?(s1, t)
is true for some t in t1...tn."
Limited type collections in a type-union do not obey this:
define constant <text-coll> = limited(<simple-vector>, of: <string>);
define constant <num-coll> = limited(<simple-vector>, of: <integer>);
subtype?(<text-coll>, type-union(<text-coll>, <num-coll>)) /* => #f */
This is because of the backstop method in fundev/sources/dylan/types.dylan
(line 500-ish), "subtype?(t1 :: <type>, t2 :: <limited-collection-type>)," that
always returns #f. There are other methods on <singleton>, <class>, etc., but
none on <union>.
In union.dylan, there are subtype? classes on <type> and <union> that would
work correctly, but apparently the methods in types.dylan are more applicable,
so those are being used.
--
Configure bugmail: http://www.opendylan.org/cgi-bin/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
More information about the chatter
mailing list