1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

ast: disallow threads << go fn()?{} and threads << go fn()!{} (fix #16061) (#16064)

This commit is contained in:
shove
2022-10-14 00:37:27 +08:00
committed by GitHub
parent f0108323d1
commit 51a9e89c4a
3 changed files with 18 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
vlib/v/checker/tests/go_append_optional_to_threads_err.vv:5:12: error: cannot append `thread !` to `[]thread`
3 | fn main() {
4 | mut ths := []thread{}
5 | ths << go foo()
| ~~~~~
6 | ths.wait()
7 | }

View File

@@ -0,0 +1,7 @@
fn foo() ! {}
fn main() {
mut ths := []thread{}
ths << go foo()
ths.wait()
}