Struct inheritance

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Thu Sep 19 19:12:36 UTC 2024


On 20/09/2024 7:04 AM, Richard (Rikki) Andrew Cattermole wrote:
> On 20/09/2024 6:57 AM, Nick Treleaven wrote:
>> This seems like |alias this| in disguise.
> 
> The problem with alias this, is it is not defined as the fallback when 
> nothing else in the hierarchy matches.
> 
> Here it is better defined, opDispatch should only be chosen after 
> exhausting the hierarchy, both in classes and structs.
> 
> Eliminating the issues with alias this from the design.
> 
> We can further restrict it, to only support the parent most type in the 
> hierarchy or only one in the hierarchy. In effect it allows adding a new 
> parent to the top of the hierarchy.

I should mention that this aspect of the proposal while it add new 
semantics, doesn't have anything special related to the rules of 
acceptability of opDispatch itself.

We'll need to define how opDispatch works in the hierarchy. Otherwise 
we'll have come right back to the same set of issues as alias this has.



More information about the dip.ideas mailing list