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

           Summary: Diagnostic for disable default construction should
                    improve
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from Andrej Mitrovic <[email protected]> 2013-05-16 
19:05:06 PDT ---
-----
struct S
{
    int x;
    @disable this();
    this(int x) { }
}

void main()
{
    S s;  // L12
}
-----

> test.d(12): Error: variable test.main.s initializer required for type S

This should really be:

> test.d(12): Error: struct test.S cannot be default-initialized because it has 
> a default constructor annotated with @disable

This would be similar to:

-----
struct S
{
    @disable this(this);
}

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

> test.d(11): Error: struct test.S is not copyable because it is annotated with 
> @disable

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

Reply via email to