On Sunday, 1 February 2015 at 12:21:59 UTC, Jacob Carlborg wrote:
On 2015-02-01 11:53, Dicebot wrote:Original snippet shouldn't compiler because landa argument is run-timeone but `import` must work at CT.It is resolved at compile time. Is this a CTFE vs CT problem?
CTFE function is still considered runtime function in terms of restrictions because generally there is no way to tell what context it will be evaluated in. In this specific case it is clear but making use of it would require brand new language spec. Your code is similar to this:
int foo (string s) { pragma(msg, s); return 42; }
enum ct = foo("str");
