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

parser: fix fixed array of option values (fix #19385) #19392

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

yuyi98
Copy link
Member

@yuyi98 yuyi98 commented Sep 20, 2023

This PR fix fixed array of option values (fix #19385).

  • Fix fixed array of option values.
  • Add test.
module main

fn main() {
	mut a := [3]?int{init: ?int(1)}
	a[0] = none
	a[1] = 2
	println(a)
	assert '${a}' == '[Option(none), Option(2), Option(1)]'
}

PS D:\Test\v\tt1> v run .       
[Option(none), Option(2), Option(1)]

@spytheman spytheman merged commit 175a3b2 into vlang:master Sep 20, 2023
46 checks passed
@yuyi98 yuyi98 deleted the fix_fixed_array_of_option branch September 20, 2023 13:39
Wertzui123 pushed a commit to Wertzui123/v that referenced this pull request Oct 8, 2023
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.

Initializing fixed array with optional results in error
2 participants