D-Programming-Language/dmd — pull request #1070 by 9rnsr (2012-07-29 06:41:12+00:00)
Title: Issue 8429 - [2.060 beta] 'version' rejected inside 'static if's

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

This is a regression of fixing bug 7911.
Introduced commit: e558866cdd8c26daf90942ee6dd89e814347911b

StaticIfDeclaration::setScope speculatively distributes the scope to members, and ConditionalDeclaration::setScope evaluate its condition.
So, the root cause is too early evaluation of the condition of version block which in static if.