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 match with mut cond variable (fix #22201) #22207

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

yuyi98
Copy link
Member

@yuyi98 yuyi98 commented Sep 13, 2024

This PR fix match with mut cond variable (fix #22201).

  • Fix match with mut cond variable.
  • Add test.
fn main() {
	mut aaa := ['/', 'a', 'b']
	for mut ccc in aaa {
		match ccc {
			'/' { println(ccc) }
			else { println(ccc) }
		}
	}
}

PS D:\Test\v\tt1> v run .    
/
a
b

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 4572c64 into vlang:master Sep 13, 2024
79 checks passed
@yuyi98 yuyi98 deleted the fix_match_mut_var branch September 13, 2024 06:49
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.

cgen error for for mut ccc in aaa { match ccc { where aaa is []string{}
2 participants