File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed
Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -454,7 +454,9 @@ fn (mut w Walker) expr(node_ ast.Expr) {
454454 }
455455 ast.CallExpr {
456456 w.call_expr (mut node)
457- if node.name == 'json.decode' {
457+ if node.is_fn_a_const {
458+ w.mark_const_as_used (node.name)
459+ } else if node.name == 'json.decode' {
458460 w.mark_by_type ((node.args[0 ].expr as ast.TypeNode ).typ)
459461 } else if node.name == 'json.encode' && node.args[0 ].typ != 0 {
460462 sym := w.table.final_sym (node.args[0 ].typ)
Original file line number Diff line number Diff line change 1+ import my_utils
2+
3+ fn test_main () {
4+ v := f64 (1.0 / 8 )
5+ assert my_utils.my_round (v, 2 ) == '0.13'
6+ }
Original file line number Diff line number Diff line change 1+ module my_utils
2+
3+ import strconv
4+
5+ pub const my_round = strconv.f64_ to_str_lnd1
You can’t perform that action at this time.
0 commit comments