Multiple alias this, what's the hold up?

Jonathan Marler johnnymarler at gmail.com
Sun Jun 16 06:19:25 UTC 2019


On Sunday, 16 June 2019 at 01:21:16 UTC, Timon Gehr wrote:
> On 16.06.19 03:04, Jonathan Marler wrote:
>> On Saturday, 15 June 2019 at 23:30:09 UTC, 12345swordy wrote:
>>> On Saturday, 15 June 2019 at 10:12:46 UTC, Amex wrote:
>>>> How many years has it been in limbo? 1? 2? 3? 5? 10?
>>>>
>>>> What is the hold up?
>>>
>>> What the hold up is that walter thinks it is a bad idea to 
>>> implement multiple alias this as he think it results in a 
>>> multiple inheritance problem. There has been recent 
>>> discussion regarding deprecating alias this.
>> 
>> Maybe we could add it as an optional feature enabled with a 
>> command-line option?
>> 
>> I think there's a command line format for features like this 
>> "-feature=miltialias" or something.
>> ...
>
> That probably won't fly.
>
>> That way if there really are issues we could demonstrate them 
>> and remove the feature later, or if no issues are found it 
>> could be enabled by default.
>
> In terms of lookup, the issues with multiple alias this are the 
> same as the issues with multiple import declarations. Implicit 
> conversions could use the same lookup rules, but there would 
> need to be a way to disambiguate. The code in the compiler that 
> implements import declarations is unlikely to be easily 
> reusable.

Having a hard time trying to figure out what you mean here.  I'm 
not sure what you mean by "multiple import declarations".  Is 
this what you mean?

import std.stdio;
import std.stdio;

Or maybe this?

import std.stdio;
void foo()
{
     import std.stdio;
}

Then you said "Implicit conversions could use the same lookup 
rules", but I'm not sure what you're saying there either.  Maybe 
if I understood what you meant my "import declarations" then it 
would make sense?

Sorry if I just missed something.



More information about the Digitalmars-d mailing list