[m-rev.] for test and review: class inheritance
jfischer at opturion.com
Thu Oct 19 17:06:08 AEDT 2017
On Thu, 19 Oct 2017, Zoltan Somogyi wrote:
> For review by Julien, who I am also asking to bootcheck this
> in the C# and Java grades. (oracle1 didn't let me do so myself;
> I got an error about the device being full.)
> Encode invariants about class inheritance in types.
> Make mlds_interface_id its own type, instead of identifying all
> interfaces by an MLDS type using the mlds_class_type/3 data constructors.
> Make mlds_class_id its own type, instead of identifying (almost all)
> classes by an MLDS type using the mlds_class_type/3 data constructors.
> Change the field of mlds_class_defns that says what base classes the
> class inherits from to reflect the facts that
> - the "classes" representing environments that we put on the heap
> when targeting C# or Java have a base *type*, not a base *class*, and
> - no current MLDS target language supports multiple inheritance,
> so an MLDS class cannot inherit from more than one base class.
I would be suprised if we used it, even for a target language that did
> Change the mlds_class_type data constructor of the mlds_type type
> to take a complete mlds_class_id as an argument, instead of its pieces.
> Conform to the changes above.
That looks fine. I've tested it with both the C# and Java backends
and it's fine. (I did find a bug in one of my earlier changes
but that's a different matter ...)
More information about the reviews