[Issue 10952] New: struct ctor with defaulted parameters should not be allowed

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 2 09:59:31 PDT 2013


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

           Summary: struct ctor with defaulted parameters should not be
                    allowed
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrej.mitrovich at gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-09-02 09:59:30 PDT ---
-----
struct S
{
    this(int x = 1) { assert(0); }  // never throws
}

void main()
{
    auto s = S();
}
-----

If we're really never going to support user-provided default ctors (like it is
now), then the above should become a compile-time error. That default argument
can't be used.

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