https://issues.dlang.org/show_bug.cgi?id=22865
--- Comment #2 from Basile-z <[email protected]> --- The basic problem is that the function scope is used to evaluate the enum value while we are more in a static scope that can see static things in parent scopes. There is no system for this in the D frontend now. We can only known if something static is evaluated (SCOPE.ctfe) or also if we are in a traits compile (SCOPE.compile). That fix is consequently not good but it does not break the test suite. There is something very conceptual about semantics on if the cast should be allowed or not in "particular contexts". --
