www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2354] New: conditional compilation rejects else if the declaration is a single pragma

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

           Summary: conditional compilation rejects else if the declaration
                    is a single pragma
           Product: D
           Version: 2.019
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: snake.scaly gmail.com


Compiler refuses to accept the following code:

version(Windows)
  pragma(msg, "true");
else
  pragma(msg, "false");

The compiler output is:

dmd -c test.d
test3.d(3): Declaration expected, not 'else' Also happens with static if instead of version. --
Sep 11 2008