[M3devel] Are ROOT and OBJECT END the same type?
JC Chu
jcchu at acm.org
Tue Oct 24 17:00:10 CEST 2017
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20171024/d371de20/attachment.html>
More information about the M3devel
mailing list