You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug CallExpression has access to nested captured scope when evaluating lambda parameters.
To Reproduce
Steps to reproduce the behavior:
f := (x) => (y) => x + y
add1 := f(1)
add1(x + 2)
Expected behavior add1(x + 2) returns an error because the x variable is not defined in the "global" scope.
Actual behavior add1(x + 2) returns 4 because the call expression uses the captured scope where the x variable is a lambda parameter equal to 1. So, x = 1 and y = x + 2 = 3 -> x + y = 4
The text was updated successfully, but these errors were encountered:
Describe the bug
CallExpression
has access to nested captured scope when evaluating lambda parameters.To Reproduce
Steps to reproduce the behavior:
f := (x) => (y) => x + y
add1 := f(1)
add1(x + 2)
Expected behavior
add1(x + 2)
returns an error because thex
variable is not defined in the "global" scope.Actual behavior
add1(x + 2)
returns4
because the call expression uses the captured scope where thex
variable is a lambda parameter equal to 1. So,x = 1
andy = x + 2 = 3
->x + y = 4
The text was updated successfully, but these errors were encountered: