Why doesn't symbol wheelbarrowing work with function templates?

TommiT tommitissari at hotmail.com
Sat Jun 15 02:34:15 PDT 2013


On Friday, 14 June 2013 at 05:36:32 UTC, Timon Gehr wrote:
> On 06/13/2013 11:53 AM, TommiT wrote:
>> "symbol wheelbarrowing" = "making symbols in other module(s) 
>> local to
>> the current module"
>> (described in TDPL at page 148)
>>
>> The problem:
>> -----------
>>
>> ...
>>
>> 1. alias main.bar conflicts with alias main.bar
>
> Compiler bug.

Would you also go as far as to say that you'd expect the 
following to be perfectly valid D code?

---------
module a;

void foo(T : int)() { }

---------
module b;

void foo(T : string)() { }

---------
module main;

import std.stdio;

import a;
import b;

alias foo = a.foo;
alias foo = b.foo; // [1]

void main()
{
     foo!int();
     foo!string();
}

---------
1) Error: alias main.foo conflicts with alias main.foo


More information about the Digitalmars-d mailing list