Can't evaluate enum at compile time

Andrej Mitrovic none at none.none
Fri Feb 4 08:32:07 PST 2011


import std.path : join;

enum rootdir = r"C:\Path\";
enum testdir = join(rootdir, "simple"); 

void main() { }

enumBug.d(4): Error: variable __arrayArg774 is used before initialization
enumBug.d(4): Error: cannot evaluate join("C:\\Path\\","simple",(const(char)[][0u] __arrayArg774 = void;
 , cast(const(char)[][])__arrayArg774)) at compile time
enumBug.d(4): Error: cannot evaluate join("C:\\Path\\","simple",(const(char)[][0u] __arrayArg774 = void;
 , cast(const(char)[][])__arrayArg774)) at compile time

std.path is supposed to work on strings, it doesn't touch std.file at all. Why can't it run at compile time?


More information about the Digitalmars-d-learn mailing list