On 9/14/2014 12:35 AM, Daniel Murphy wrote:
I do acknowledge this is a problem, but I am yet to run into it in actual D code. Most of my static ifs are either inside templates, inside functions, or are being used to bypass version's limitations.
A similar problem once existed in the druntime, which caused a bunch of head-scratching nastiness. The problem was the person who wrote it was trying to make an import context-dependent, i.e. behave differently depending on how it was imported.
I replaced the offending logic with straightforward code, but it does expose this dependency problem with static if.
The compiler should detect these sorts of things and reject them.
