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
The for i = ... currently checks if the index variable's value is captured, but capturing another variable in a block does not get correctly scoped. Example:
letarr=[|1..10|]letfuncs= ResizeArray()letres= ResizeArray()dofor i in[|0..9|]doletj= arr.[i]
funcs.Add(fun()-> res.Add j)for f in funcs do
f()
Running the JavaScript translation, the result of res is currently repeating 10, because a single j variable is captured in the created functions, which is not correct semantics for F#.
The text was updated successfully, but these errors were encountered:
The
for i = ...
currently checks if the index variable's value is captured, but capturing another variable in a block does not get correctly scoped. Example:Running the JavaScript translation, the result of
res
is currently repeating 10, because a singlej
variable is captured in the created functions, which is not correct semantics for F#.The text was updated successfully, but these errors were encountered: