Skip to content

cgen: fix printing fixed array of options (fix #19469) - #19479

Merged
spytheman merged 1 commit into
vlang:masterfrom
yuyi98:fix_gen_str_array_fixed
Sep 30, 2023
Merged

spytheman merged 1 commit into
vlang:masterfrom
yuyi98:fix_gen_str_array_fixed

Conversation

@yuyi98

@yuyi98 yuyi98 commented Sep 30, 2023

Copy link
Copy Markdown
Member

This PR fix printing fixed array of options (fix #19469).

  • Fix printing fixed array of options.
  • Add test.
fn main() {
	a1 := [?string('foo'), ?string(none)]!
	dump(a1)

	a2 := [?int(22), ?int(none)]!
	dump(a2)

	a3 := [?f64(22.2), ?f64(none)]!
	dump(a3)

	a4 := [?bool(true), ?bool(none)]!
	dump(a4)
}

PS D:\Test\v\tt1> v run .       
[.\\tt1.v:3] a1: [Option('foo'), Option(none)]
[.\\tt1.v:6] a2: [Option(22), Option(none)]
[.\\tt1.v:9] a3: [Option(22.2), Option(none)]
[.\\tt1.v:12] a4: [Option(true), Option(none)]

@spytheman
spytheman merged commit 80339c8 into vlang:master Sep 30, 2023
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.

dump of a fixed array of option strings fails to compile

2 participants