-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
vlib: use defer(fn) { syntax where appropriate
#25653
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
Conversation
defer(en) { syntax where appropriatedefer(fn) { syntax where appropriate
| mut res := 0 | ||
| $if trace_ssl ? { | ||
| defer { | ||
| defer(fn) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this need to be changed?
Because it is inside a the comptime $if scope, or for some other reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly, defer uses the comptime $if scope, in a future PR I will make defer use the parent scope instead of that one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work.
Continuation of PR #25639.
Merge after PR #25651.This PR makes use of the syntax
defer(fn) {where appropriate.v -scoped-defer -o v cmd/vworks!