elvish icon indicating copy to clipboard operation
elvish copied to clipboard

Defer inside a for loop causes early exit

Open xiaq opened this issue 1 year ago • 0 comments

What happened, and what did you expect to happen?

This is unexpected:

for v [a b c] {
  defer { put defered }
  put $v
}
▶ a
▶ defered

Output of "elvish -version"

0.22.0-dev.0.20241002144851-c20fac4126aa-dirty

Code of Conduct

xiaq avatar Oct 15 '24 10:10 xiaq