[Issue 1301] CTFE fails for ImportExpressions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jun 30 07:37:40 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1301


fvbommel at wxs.nl changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




------- Comment #1 from fvbommel at wxs.nl  2007-06-30 09:37 -------
Functions to be used in CTFE must still be compilable as normal functions.
Yours doesn't meet that criterion. Try something like:
---
char[] foo(char[] path)()
{
    char[] t = import(path); //Error: file name argument must be a string, not
(path)

    return "";
}

void main(char[][] args)
{
   mixin(foo!("template"));
}
---


-- 



More information about the Digitalmars-d-bugs mailing list