www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2624] New: A string mixin should be allowed wherever a type + storage class is

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2624

           Summary: A string mixin should be allowed wherever a type +
                    storage class is
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: andrei metalanguage.com


The following code should compile:

mixin("ref int") f() { static int x; return x; }

This would allow sidestepping the thorny issue of returning a value or a
reference depending on a compile-time condition. Same goes about parameters,
e.g. this should work too:

void f(mixin("ref int") x) { }


-- 
Jan 27 2009
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2624





------- Comment #1 from 2korden gmail.com  2009-01-28 03:04 -------
Do you mean that the following should be allowed, too?

class Foo
{
    void bar() mixin("const")
    {
    }
}


-- 
Jan 28 2009