Skip to content

Conversation

@StunxFS
Copy link
Contributor

@StunxFS StunxFS commented Nov 3, 2025

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/v works!

@StunxFS StunxFS changed the title vlib: use defer(en) { syntax where appropriate vlib: use defer(fn) { syntax where appropriate Nov 3, 2025
mut res := 0
$if trace_ssl ? {
defer {
defer(fn) {
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.

@spytheman spytheman merged commit 82cd44e into vlang:master Nov 4, 2025
91 of 92 checks passed
@StunxFS StunxFS deleted the vlib/use-new-defer-syntax branch November 4, 2025 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants