Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defer inside a for loop causes early exit #1849

Open
1 task done
xiaq opened this issue Oct 15, 2024 · 0 comments · May be fixed by #1862
Open
1 task done

Defer inside a for loop causes early exit #1849

xiaq opened this issue Oct 15, 2024 · 0 comments · May be fixed by #1862
Labels

Comments

@xiaq
Copy link
Member

xiaq commented Oct 15, 2024

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 xiaq added the bug label Oct 15, 2024
@xiaq xiaq moved this from ❓Triage to 🧭Recon in All Elvish issues Oct 15, 2024
@MrOverlord MrOverlord linked a pull request Nov 18, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🧭Recon
Development

Successfully merging a pull request may close this issue.

1 participant