File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ struct Story {
11
11
}
12
12
13
13
fn worker_fetch (p & sync.PoolProcessor, cursor int , worker_id int ) voidptr {
14
- id := p.get_item < int > (cursor)
14
+ id := p.get_int_item (cursor)
15
15
resp := http.get ('https://hacker-news.firebaseio.com/v0/item/${id} .json' ) or {
16
16
println ('failed to fetch data from /v0/item/${id} .json' )
17
17
return sync.no_result
@@ -45,5 +45,5 @@ fn main() {
45
45
// cases is what you want anyway... You can override the automatic choice
46
46
// by setting the VJOBS environment variable too.
47
47
// fetcher_pool.set_max_jobs( 4 )
48
- fetcher_pool.work_on_items (ids)
48
+ fetcher_pool.work_on_items_i (ids)
49
49
}
Original file line number Diff line number Diff line change @@ -759,6 +759,8 @@ pub fn (mut c Checker) call_fn(call_expr mut ast.CallExpr) table.Type {
759
759
c.error ('json.decode: first argument needs to be a type, got `$typ `' , call_expr.pos)
760
760
return table.void_type
761
761
}
762
+ c.expected_type = table.string_type
763
+ call_expr.args[1 ].typ = c.expr (call_expr.args[1 ].expr)
762
764
typ := expr as ast.Type
763
765
return typ.typ.set_flag (.optional)
764
766
}
Original file line number Diff line number Diff line change @@ -1270,7 +1270,7 @@ fn (mut g Gen) expr(node ast.Expr) {
1270
1270
g.write ('.' )
1271
1271
}
1272
1272
if it .expr_type == 0 {
1273
- verror ('cgen: SelectorExpr typ=0 field= $it.field $g.file.path $it.pos.line_nr ' )
1273
+ verror ('cgen: SelectorExpr | expr_type: 0 | it.expr: ` ${it.expr} ` | field: ` $it.field ` | file: $g.file.path | line: $it.pos.line_nr ' )
1274
1274
}
1275
1275
g.write (c_name (it .field))
1276
1276
}
You can’t perform that action at this time.
0 commit comments