[Issue 1819] New: spurious warning about missing return statement after synchronized

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 7 13:41:13 PST 2008


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

           Summary: spurious warning about missing return statement after
                    synchronized
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: andrei at metalanguage.com


In std.thread, the following code can't compile with warnings:

    static Thread[] getAll()
    {
        synchronized (Thread.classinfo) return allThreads[0 .. allThreadsDim];
    }

The compiler complains that there is no return at the end of the function. This
warning should be removed because all paths inside synchronized do return.


-- 



More information about the Digitalmars-d-bugs mailing list