I just encountered a familiar problem again ...

uint fn(uint a)
{
    final switch(a)
    {
        case 1 :
            do
            {
                a++;
                if (a == 17) break;
            } while(a < 20);
                return a;

        case 2 : return 1;
    }
}

static assert(fn(1) == 17); // fails because the return is 20
static assert(fn(2) == 1);

It turns out I forgot use the facility I implemented to handle this on DoStatements as well.
This is now fixed.


Reply via email to