Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Dec 15, 2024
1 parent b39cad2 commit 992608e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vlib/v/checker/fn.v
Original file line number Diff line number Diff line change
Expand Up @@ -1422,6 +1422,9 @@ fn (mut c Checker) fn_call(mut node ast.CallExpr, mut continue_check &bool) ast.
if !c.table.sym(c.unwrap_generic(node.args[0].typ)).has_method('str') {
c.table.used_features.auto_str = true
} else {
if node.args[0].typ.has_flag(.option) {
c.table.used_features.option_or_result = true
}
c.table.used_features.print_types[node.args[0].typ.idx()] = true
}
if node.args[0].typ.is_ptr() {
Expand Down
1 change: 1 addition & 0 deletions vlib/v/tests/skip_unused/option_int_println.run.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Option(none)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Option(none)
4 changes: 4 additions & 0 deletions vlib/v/tests/skip_unused/option_int_println.vv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fn main() {
n := ?int(none)
println(n)
}

0 comments on commit 992608e

Please sign in to comment.