[Issue 8080] New: 'alias this' causes toString to be shadowed by aliased object

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu May 10 12:59:16 PDT 2012


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

           Summary: 'alias this' causes toString to be shadowed by aliased
                    object
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: hsteoh at quickfur.ath.cx


--- Comment #0 from hsteoh at quickfur.ath.cx 2012-05-10 13:00:39 PDT ---
Code:
        struct S {
                short[4] data;
                alias this data;

                string toString() { ... }
        }
        ...
        S s;
        writeln(to!string(s));

In dmd 2.059 (I believe) and earlier, this calls S.toString(). However,
in git dmd, this calls data.toString() instead.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list