Skip to content

markused: fix option array element#25179

Merged
spytheman merged 1 commit into
vlang:masterfrom
felipensp:fix_opt_array_init_none
Aug 29, 2025
Merged

markused: fix option array element#25179
spytheman merged 1 commit into
vlang:masterfrom
felipensp:fix_opt_array_init_none

Conversation

@felipensp

Copy link
Copy Markdown
Member

Fix #23089

@huly-for-github

Copy link
Copy Markdown

Connected to Huly®: V_0.6-24209

@felipensp felipensp marked this pull request as ready for review August 28, 2025 10:47
if c := a[0] {
println('c: ${c} not none!')
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This also cgen errors, I think we should add a similar fix for it too:

mut m := map[int]?u32{}
if c := m[0] {
	println('c:  ${c} not none!')
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I filed a separate #25186 for it.

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

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 38bfc48 into vlang:master Aug 29, 2025
83 of 84 checks passed
@felipensp felipensp deleted the fix_opt_array_init_none branch August 29, 2025 11:29
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.

Array of options (like ?u32(none))

2 participants