Closed edemaine closed 1 month ago
I ran into the first one the other day, but in a slightly different way so I didn't file an issue about it:
arr.map
if &.x
foo
else if &.y
bar
else
baz
arr.map(($) =>
$.x
? foo
: ($1) => {
if ($1.y) {
return bar;
} else {
return baz;
}
}
);
if/then
I expected this to be a single function, but each
&
gets treated as its own function wrapper. By contrast,?:
works fine:Assignment
The docs say that we don't lift beyond an assignment, but I find this not to be the case: