On Phobos GC hunt

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Fri Oct 10 14:21:41 PDT 2014


On Fri, 10 Oct 2014 09:14:28 +0200
Marco Leise via Digitalmars-d <digitalmars-d at puremagic.com> wrote:

> Am Wed, 8 Oct 2014 23:20:13 +0300
> schrieb ketmar via Digitalmars-d <digitalmars-d at puremagic.com>:
> 
> > On Wed, 08 Oct 2014 13:10:11 -0700
> > Andrei Alexandrescu via Digitalmars-d <digitalmars-d at puremagic.com>
> > wrote:
> > 
> > > Or would "static if (__ctfe)" work? -- Andrei
> > ha! The Famous Bug! it works, but not as people expected. as "static
> > if" evaluates when function is *compiling*, __ctfe is false there,
> > and so the whole "true" branch will be removed as dead code.
> > 
> > i believe that compiler should warn about this, 'cause i'm tend to
> > repeatedly hit this funny thing.
> 
> Lol, definitely! I made that mistake myself and Robert
> Schadek, too in his std.logger. It is now the #1 bug in D code.

i made a quick patch that warns on "static if (__ctfe)":
https://issues.dlang.org/show_bug.cgi?id=13601
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141011/3c35eebf/attachment.sig>


More information about the Digitalmars-d mailing list