[Issue 2030] New: String mixin within teplatate mixin doesn't compile

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 24 15:16:35 PDT 2008


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

           Summary: String mixin within teplatate mixin doesn't compile
           Product: D
           Version: 2.013
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: bartosz at relisoft.com


The following code doesn't compile:
template foo (string init)
{
    mixin ("string str = \"" ~ init ~ "\";");
}

mixin (foo !("hello"));

attribute argument to mixin must be a string, not (foo!("hello"))

Analogous code without a string mixin works:

template bar (string s)
{
    string str = s;
}

mixin bar!("hello");


-- 



More information about the Digitalmars-d-bugs mailing list