rascal
rascal copied to clipboard
Two binds on both sides of the OR operator don't work if they are in a nested expression.
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