[M3devel] Are ROOT and OBJECT END the same type?

JC Chu jcchu at acm.org
Wed Oct 25 04:31:33 CEST 2017


Thanks.  §2.9 does say that if the prefix "is omitted, it defaults to ROOT".

- JC


From: Hosking, Antony L [mailto:hosking at purdue.edu]
Sent: Tuesday, October 24, 2017 23:13
To: JC Chu <jcchu at acm.org>
Cc: m3devel at elegosoft.com
Subject: Re: [M3devel] Are ROOT and OBJECT END the same type?

OBJECT END is the same as ROOT OBJECT END.  All object types inherit from ROOT.
Sent from my iPad

On Oct 24, 2017, at 8:00 AM, JC Chu <jcchu at acm.org<mailto:jcchu at acm.org>> wrote:
First, no subtyping rule is given for pairs of branded and unbranded types.  For example, it's neither the case that BRANDED REF BOOLEAN <: REF BOOLEAN nor vice versa, based on what's given in §2.10.  This explains why the an opaque type declared as a subtype of the latter cannot be revealed to be the former.

By the same reasoning, the compiler is also correct in rejecting T <: OBJECT END to be revealed as T = BRANDED OBJECT END, ... or is it?

It's pretty common to declare some T <: ROOT and then reveal T as a branded object type.  So the fact that the revelation above is not accepted means that ROOT and OBJECT END are not the same type.  But according to §2.9, ROOT is "the traced object type with no fields or methods", which (I think) is OBJECT END.  Or am I missing something here?

- JC

_______________________________________________
M3devel mailing list
M3devel at elegosoft.com<mailto:M3devel at elegosoft.com>
https://m3lists.elegosoft.com/mailman/listinfo/m3devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20171025/2f274599/attachment-0001.html>


More information about the M3devel mailing list