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

checker: check fntype mismatch of struct field init (fix #16372) (#16381)

This commit is contained in:
yuyi
2022-11-11 02:19:19 +08:00
committed by GitHub
parent 196b01aef7
commit 993e21e85b
10 changed files with 35 additions and 9 deletions

View File

@@ -9,14 +9,14 @@ pub struct IResult {
i int
}
fn worker_s(p &pool.PoolProcessor, idx int, worker_id int) &SResult {
fn worker_s(mut p pool.PoolProcessor, idx int, worker_id int) &SResult {
item := p.get_item<string>(idx)
println('worker_s worker_id: $worker_id | idx: $idx | item: $item')
time.sleep(3 * time.millisecond)
return &SResult{'$item $item'}
}
fn worker_i(p &pool.PoolProcessor, idx int, worker_id int) &IResult {
fn worker_i(mut p pool.PoolProcessor, idx int, worker_id int) &IResult {
item := p.get_item<int>(idx)
println('worker_i worker_id: $worker_id | idx: $idx | item: $item')
time.sleep(5 * time.millisecond)