mono/sharpen

Invalid code generated for loops

Opened this issue · 0 comments

The following function:

void errorExample() {
    if (true) {
        for (int i = 0; i < 3; i++) {
        }
    }

    for (int i = 0; i < 3; i++) {
    }

    if (true) {
        for (int i = 0; i < 3; i++) {
        }
    }
}

currently produces the following invalid result:

internal virtual void ErrorExample()
{
    if (true)
    {
        for (int i = 0; i < 3; i++)
        {
        }
    }
    for (int i_1 = 0; i_1 < 3; i_1++)
    {
    }
    if (true)
    {
        for (int i = 0; i_1 < 3; i_1++)
        {
        }
    }
}