Bug 2354 – conditional compilation rejects else if the declaration is a single pragma
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2008-09-11T11:34:00Z
Last change time
2017-07-22T12:36:06Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
snake.scaly
Comments
Comment #0 by snake.scaly — 2008-09-11T11:34:04Z
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.