Stack overflow

Timon Gehr timon.gehr at gmx.ch
Mon Jun 25 04:01:47 PDT 2012


On 06/25/2012 02:48 AM, Jonathan M Davis wrote:
> On Sunday, June 24, 2012 19:03:17 Namespace wrote:
>>> This might work:
>>>
>>> this(U)(U obj)
>>>
>>>      if(is(U : T)&&  !is(U == typeof(null)))
>>>
>>> {
>>> }
>>>
>>>
>>> - Jonathan M Davis
>>
>> Interesting. With or wihtout that, if i add a method to Foo it
>> prints "Stack overflow" also.
>>
>> http://dpaste.dzfl.pl/91dad66c
>>
>> Can you explain that?
>
> Wait, you have a template mixin inside of Foo which passes Foo to it? I don't
> know if you can get away with that or not, since you're trying to pass a type
> to a template while you're adding stuff to it via that template. So, the type
> is incomplete. I'm willing to be that that's your problem, but I don't know.
>
> - Jonathan M Davis

This is fine. I am doing it all the time.
Why are we discussing this compiler bug on the main newsgroup though?


More information about the Digitalmars-d-learn mailing list