https://d.puremagic.com/issues/show_bug.cgi?id=12295

           Summary: wrongly accepts ctor with optional parameter
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from Timothee Cour <[email protected]> 2014-03-03 
15:43:28 PST ---
D20140303T153856

struct A{
  int x;
  this(int x=10){this.x=x;} //Shouldn't allow this as we can't have
parameter-less ctors
}

void main(){
  auto a=A();
  assert(a.x==10); //FAILS
}

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

Reply via email to