www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12295] New: wrongly accepts ctor with optional parameter

reply d-bugmail puremagic.com writes:
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: nobody puremagic.com
        ReportedBy: timothee.cour2 gmail.com


--- Comment #0 from Timothee Cour <timothee.cour2 gmail.com> 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: -------
Mar 03 2014
parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12295


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrej.mitrovich gmail.com
         Resolution|                            |DUPLICATE


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2014-03-04
02:59:32 PST ---
*** This issue has been marked as a duplicate of issue 3438 ***

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