https://issues.dlang.org/show_bug.cgi?id=7386

--- Comment #5 from Iain Buclaw <[email protected]> ---
Potentially very breaking, but declaring versions could be even more
restrictive than it currently is.

i.e: When setting a version in a function or user defined type, you expect a
compile-time error.

    Error: version `Foo` declaration must be at module level

This could be extended to `static if` as well so that we avoid all these nasty
cases of will it, won't it work.  Also noting that it's currently an error to
declare a version inside a `static foreach`.

---
static foreach (_; 0 .. 5) {
    version = Foo;  // Error: version `Foo` declaration must be at module level
}
---

So why is `static if` different here?

--

Reply via email to