DIP66 - Multiple alias this

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Fri Oct 10 13:47:45 PDT 2014


On 10/10/14 1:09 PM, IgorStepanov wrote:
> I've created DIP for my pull request.
> DIP: http://wiki.dlang.org/DIP66
> PR: https://github.com/D-Programming-Language/dmd/pull/3998
>
> Please, comment it.

This part:

void test()
     {
         C c;
         int i = c; //Error: c.a.i vs c.b.i
     }

     static assert(is(C : int)); //Ok, because C is subtype of int anyway.

I think might be wrong. There is a lot of code out there that says, e.g.:

void foo(T)(T t) if(is(T : U))
{
   U u = t;
   ...
}

Which will now create an error in the wrong place. IMO, the 'is' test 
should also fail.

-Steve


More information about the Digitalmars-d mailing list