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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 24 15:30:46 PDT 2008


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


ary at esperanto.org.ar changed:

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




------- Comment #1 from ary at esperanto.org.ar  2008-04-24 17:30 -------
No, the analogous code is

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

mixin (bar!("hello"));

and it doesn't compile (and it shouldn't).

Notice the parenthesis after mixin. There's a difference between

mixin something;

and

mixin (something);

The first one is a template mixin
(http://digitalmars.com/d/1.0/template-mixin.html), the second one is a mixin
(http://www.digitalmars.com/d/1.0/mixin.html).

This compiles correctly:

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

mixin bar!("hello");


-- 



More information about the Digitalmars-d-bugs mailing list