Bug 8696 – Compiler reports incorrect dangling else with version attributes
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-09-19T12:16:00Z
Last change time
2012-09-19T21:03:29Z
Assigned to
nobody
Creator
alex
Comments
Comment #0 by alex — 2012-09-19T12:16:22Z
$ cat test.d
version (Posix):
version (linux)
{
}
else version (OSX)
{
}
else
{
}
$ <> dmd -w -lib test.d
test.d(9): Warning: else is dangling, add { } after condition at test.d(1)
test.d(6): Warning: else is dangling, add { } after condition at test.d(1)
I don't see any reason at all that this should be considered a dangling else case.