Skip to content

Commit cd7e9a1

Browse files
authored
markused: fix thread type mark by go/spawn expr (fix #25049) (#25054)
1 parent c3dc075 commit cd7e9a1

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

‎vlib/v/markused/walker.v‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,7 @@ fn (mut w Walker) expr(node_ ast.Expr) {
519519
if node.is_expr {
520520
w.fn_by_name('free')
521521
}
522+
w.mark_by_type(w.table.find_or_register_thread(node.call_expr.return_type))
522523
w.expr(node.call_expr)
523524
w.uses_spawn = true
524525

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
fn f() ! {
2+
println('hi')
3+
}
4+
5+
fn g() int {
6+
println('hi')
7+
return 23
8+
}
9+
10+
fn test_main() {
11+
_ = go f()
12+
_ := spawn g()
13+
}

0 commit comments

Comments
 (0)