[Issue 7232] Warning: statement is not reachable has no line number

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jan 6 08:51:03 PST 2012


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


Kenji Hara <k.hara.pg at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> 2012-01-06 08:51:01 PST ---
https://github.com/D-Programming-Language/dmd/pull/610

In addArticle function, dmd translates the body code like follows:

try {
  return true;
}
catch (Throwable __o) {
  return false;
  throw __o;  // #1 rethrow catched exception object
}

The "statement is not reachable" warning is caused by line #1.

After my patch, the translation result would change like follows:

try {
  return true;
}
catch (Throwable __o) {
  return false;   // this statement never fall through next.
                  // so next unreachable rethrowing is implicitly removed.
}

Finally, original warning would never be generated.

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