On 28/10/2015 4:02 PM, tsbockman wrote:
(But not all control flow statements have static equivalents, so this solution can only be applied to some code. Even if we had `static switch`, `static foreach`, `static goto`, etc., I doubt that forcing the user to segregate all compile-time logic from the run-time logic in that way is desirable.)
Nobody is forcing anyone to do this. Warnings are opt-in.
Whether the logic is explicitly `static` (compile time) or not, the warning should be issued if and only if the flagged code is unreachable with all possible input combinations - including both compile-time and run-time.
In D's compilation model it is not possible to know all possible instantiations at compilation time.
