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

cgen: fix assign optional aliases of fixed array (fix #23185) #23188

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

yuyi98
Copy link
Member

@yuyi98 yuyi98 commented Dec 17, 2024

This PR fix assign optional aliases of fixed array (fix #23185).

  • Fix assign optional aliases of fixed array.
  • Add test.
type Addr = [4]u8

fn main() {
	mut addr := ?Addr(none)
	addr = Addr([u8(1), 2, 3, 4]!)
	println(addr)
	assert '${addr}' == 'Option(Addr([1, 2, 3, 4]))'
}

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

Huly®: V_0.6-21625

@spytheman spytheman force-pushed the fix_option_alias_of_farray branch from 898c49b to 13c587c Compare December 17, 2024 07:08
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 9a6e335 into vlang:master Dec 17, 2024
72 checks passed
@yuyi98 yuyi98 deleted the fix_option_alias_of_farray branch December 18, 2024 02:06
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.

C error on assign aliased fixed array to option variable
3 participants