[Issue 12124] New: Never be used static opCall should be reported

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Feb 9 18:58:07 PST 2014


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

           Summary: Never be used static opCall should be reported
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2014-02-09 18:57:56 PST ---
From:
https://github.com/D-Programming-Language/dmd/pull/3221#issuecomment-34595032

By fixing issue 12070, this code never asserts in runtime.

struct S
{
    this(int) {}
    static S opCall()
    {
        assert(0);
    }
}
void main()
{
    auto s = S();
}

To avoid silent code breaking, compiler should report message that static
opCall is never used.

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


More information about the Digitalmars-d-bugs mailing list