statement is not reachable

Jarrett Billingsley jarrett.billingsley at gmail.com
Thu Mar 5 06:20:42 PST 2009


On Thu, Mar 5, 2009 at 3:17 AM, Qian Xu <quian.xu at stud.tu-ilmenau.de> wrote:

>  this(char[] s, int flag) {
>    if (flag == 1)
>    {
>      this(1);
>      return;
>    }
>    else if (flag == 2)
>    {
>      this("hello");
>      return;
>    }
>    throw new Exception("unhandled case");
>    this(0); // fake

This line is unreachable.  The 'throw' before it makes it impossible
for it to ever execute.  Just take out this line.


More information about the Digitalmars-d-learn mailing list