Workaround for DIP 1005

Dominikus Dittes Scherkl via Digitalmars-d digitalmars-d at puremagic.com
Fri Feb 10 05:36:42 PST 2017


On Friday, 10 February 2017 at 13:28:43 UTC, Dominikus Dittes 
Scherkl wrote:
Sorry, accidentally hit some key-combination that immediately 
send the message that was not yet complete.

> With my original proposal you would write
>
> auto foo(foo.SysTime st1,
>          foo.SysTime st2,
>          foo.Duration d)
> {
>    import std.datetime;
      alias SysTime = std.datetime.SysTime;
      alias Duration = std.datetime.Duration;

> }

And the implementation of DIP1005 would only "create this alias 
automatically", so that you would write what you always did - if 
any type in a declaration is not found, the compiler tries to 
find it in the function definition and use that instead.

Therefore I would call this "auto aliasing"

It does not inquire a (visible) language change, only an enhanced 
lookup within the compiler.




More information about the Digitalmars-d mailing list