www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - const/static bug with string concatenation

This produces Internal error: ..\ztc\cgcs.c 353

class PathUtil {

    public static wchar[] combine(wchar[] path1, wchar[] path2) {
        return path1 ~ DIRECTORY_SEPARATOR_CHAR ~ path2;
    }

    public const wchar DIRECTORY_SEPARATOR_CHAR = '\\';

}

If DIRECTORY_SEPARATOR_CHAR is redefined as static instead of const, all's 
well. 
Jun 30 2005