[Issue 2913] New: aliasing a ref type is not possible

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Apr 29 15:12:54 PDT 2009


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

           Summary: aliasing a ref type is not possible
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: andrei at metalanguage.com


alias ref int rint;

rint foo() { static int x; return x; }

void main()
{
    auto p = &(foo());
}

This doesn't work. It led me to write the ugliest code I have ever written.
Search std.range for "mixin" if you want to see ugly stuff.


-- 



More information about the Digitalmars-d-bugs mailing list