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 the spawn or go expr to the []thread(fix #19365) #19366

Merged
merged 1 commit into from
Sep 16, 2023

Conversation

shove70
Copy link
Contributor

@shove70 shove70 commented Sep 16, 2023

  1. Fix cgen error: assign the spawn or go expr to the []thread #19365
  2. Add tests.
fn main() {
	mut threads := []thread{len: 1}

	threads[0] = spawn fn () {
		a := 1
		dump(a)
		assert true
	}()

	threads.wait()
}

output:

[a.v:6] a: 1

@medvednikov medvednikov merged commit 255e724 into vlang:master Sep 16, 2023
47 checks passed
@shove70 shove70 deleted the thread branch September 16, 2023 11:59
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: assign the spawn or go expr to the []thread
3 participants