rascal icon indicating copy to clipboard operation
rascal copied to clipboard

Two binds on both sides of the OR operator don't work if they are in a nested expression.

Open DavyLandman opened this issue 1 year ago • 0 comments

void main(set[value] y, set[value] z) {
    if(/int x := y || /int x := z) {
        println(x);
    }

    if ((/int x := y && /x := z) || (/int x := z && /x := y)) {
        println(x);
    }
}

The first if works fine, and the typechecker sees that int x is not a double declaration because it happens on both sides of the ||. But the second one, where the int x is inside of a () sub-expression, it gives the error:

Double declaration of `x` at 

DavyLandman avatar Aug 30 '24 12:08 DavyLandman