Well... it sorta does. static if does not introduce a new scope, even
with

{}, and this only happens with attributes.
-Steve

in which case
static if(cond) {
immutable:
}
int x;
should not create x as immutable if cond is true. The current
behavior is not consistent with attribute either.

Ugh, that is really bad. It shouldn't do that. Is that intentional?

Yes. Semantic scope and lexical scope are different things. The ':'
thing applies to the remaining statements in the lexical scope. 'static
if' does not create a new semantic scope, even though the { } suggests
it does.

deadalnix's suggestion, at least to me, was that currently the compiler
would attribute immutable to int x. Testing, I see it does not. Maybe I
misinterpreted the implication. The statement "current behavior is not
consistent with attribute" seems wrong then.

There have been several suggestions to make 'static if' apply
independently of the rest of the grammar, i.e. allow things like: