title: Is there really a valid code-path where this function won't return a value?
body: <p>I have the below function that iterates over a list of workers, invoking their DoStuff() method. If the first worker fails, I try the next one until I'm out of workers. If they all fail, I re-throw the last exception.</p>
  
  <pre><code>// workers is an IList&lt;&gt;.
  public object TryDoStuff()
  {
      for (int i = 0; i &lt; workers.Count; i++)
      {
          try
          {
              return worker[i].DoStuff();
          }
          catch
          {
              if (i == workers.Count - 1)
              {
                  throw; // This preserves the stack trace
              }
              else
              {
                  continue; // Try the next worker
              }
          }
      }
  }
  </code></pre>
  
  <p>When compiling, I get an error that "not all code paths return a value" for this function. Although I can silence the error by adding an explicit return after the for loop, I'm doubting the compiler is accurate here as I don't see how the for loop will be escaped without either returning or re-throwing an exception. And if an exception is re-thrown, not returning a value is valid.</p>
  
  <p>What am I missing? Is csc unable to reason about the conditional in the catch block?</p>