On Fri, 10 Oct 2014 09:14:28 +0200 Marco Leise via Digitalmars-d <[email protected]> wrote:
> Am Wed, 8 Oct 2014 23:20:13 +0300 > schrieb ketmar via Digitalmars-d <[email protected]>: > > > On Wed, 08 Oct 2014 13:10:11 -0700 > > Andrei Alexandrescu via Digitalmars-d <[email protected]> > > 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
signature.asc
Description: PGP signature
