[Issue 6094] && doesn't shortcut properly with CTFE

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jun 3 06:33:31 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6094



--- Comment #5 from Steven Schveighoffer <schveiguy at yahoo.com> 2011-06-03 06:29:02 PDT ---
The problem I see with allowing this is, it won't compile as non-CTFE, even
though normally CTFE-able functions can still be used during runtime.

For example, if you have this:

string foo()
{
   if(0 && "hello" == 1)
      return "impossible!";
   return "abc";
}

Then how does one mark this as "don't compile this in normal mode, only compile
this during ctfe".  I suppose you could do version(ctfe) around the function,
but I feel this is just as easy (and more accurate) to redo with a static if.

I really think this bug is invalid, but I won't change it in case I'm wrong :)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list