From the vibe.d source:
------
version (VibeCustomMain) {}
else:
------
The language specification does not say that "else:" is valid, and it is not consistent with the normal usage of "else". If you try this with a normal else block, the compiler correctly gives the error message "Error: found ':' instead of statement".
Comment #1 by andrej.mitrovich — 2014-05-13T10:30:10Z
Seems like more of a spec issue than accepts-invalid to me. Disallowing this would break a ton of code for no benefit.
Comment #2 by k.hara.pg — 2014-05-29T02:21:37Z
The issue is in the definition of ConditionalDeclaration.
$(GNAME ConditionalDeclaration):
$(GLINK Condition) $(GLINK DeclarationBlock)
$(GLINK Condition) $(GLINK DeclarationBlock) $(D else) $(GLINK DeclarationBlock)
$(GLINK Condition) $(D :) $(GLINK DeclDefs)$(OPT)
In here, `version(id): ...` is explicitly allowed but `version(id) ... else:` is not.
To fix the issue, ConditionalDeclaration should have following additional grammar.
$(GLINK Condition) $(GLINK DeclarationBlock) $(D else) $(D :) $(GLINK DeclDefs)$(OPT)
Comment #3 by k.hara.pg — 2014-05-29T02:23:47Z
*** Issue 12818 has been marked as a duplicate of this issue. ***