[Issue 8238] New: regression: templates can create ghost fields

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jun 14 07:34:00 PDT 2012


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

           Summary: regression: templates can create ghost fields
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: timon.gehr at gmx.ch


--- Comment #0 from timon.gehr at gmx.ch 2012-06-14 07:36:12 PDT ---
DMD 2.059:

struct S{ template t(){ int t; } }
void main(){
    S s,t;
    writeln(t.t!());            // 0
    s.t!()=256;
    writeln(t.t!()," ",s.t!()); // 1 256
}

The code is illegal, but accepted.
I remember that such code used to be rejected.

-- 
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