[dmd-beta] D2 2.058 beta
    Martin Nowak 
    dawg at dawgfoto.de
       
    Fri Feb 10 12:05:40 PST 2012
    
    
  
>> This compiles for me without error. When it runs, I get a stack  
>> overflow.
>> The reason looks clear - foo(Args) is recursively calling itself. I  
>> don't
>> think it's a bug in dmd.
>>
>
> I retried above code using new beta on two environments.
>
> Mac OS X 10.6.8 causes segmentation fault, but
> Scientific Linux release 6.0 64bit works fine.
>
> Does D allow above code?
If I understand that correctly then the chosen overload differs.
This prints "variadic" for me. Can you recheck this for other setups
and file a bug.
IMHO this should be an ambiguous overload error.
-----
import std.stdio;
struct S
{
     void foo(V)(in V v)
     {
         writeln("non-variadic");
     }
     void foo(Args...)(auto ref const Args args)
     {
         writeln("variadic");
     }
}
void main()
{
     S s;
     s.foo(10);
}
    
    
More information about the dmd-beta
mailing list