diff --git a/vlib/builtin/builtin.v b/vlib/builtin/builtin.v index 7f83d0ef7698f9..ba6c8c8c07055e 100644 --- a/vlib/builtin/builtin.v +++ b/vlib/builtin/builtin.v @@ -5,7 +5,7 @@ module builtin // isnil returns true if an object is nil (only for C objects). -@[inline; markused] +@[inline] pub fn isnil(v voidptr) bool { return v == 0 } diff --git a/vlib/v/checker/str.v b/vlib/v/checker/str.v index 75f8ae987426c0..e5cec6f149b728 100644 --- a/vlib/v/checker/str.v +++ b/vlib/v/checker/str.v @@ -56,12 +56,12 @@ fn (mut c Checker) string_inter_lit(mut node ast.StringInterLiteral) ast.Type { if c.pref.skip_unused && !c.is_builtin_mod { if !c.table.sym(ftyp).has_method('str') { c.table.used_features.auto_str = true - if ftyp.is_ptr() { - c.table.used_features.auto_str_ptr = true - } } else { c.table.used_features.print_types[ftyp.idx()] = true } + if ftyp.is_ptr() { + c.table.used_features.auto_str_ptr = true + } c.table.used_features.interpolation = true } c.fail_if_unreadable(expr, ftyp, 'interpolation object') diff --git a/vlib/v/tests/skip_unused/auto_string.run.out b/vlib/v/tests/skip_unused/auto_string.run.out new file mode 100644 index 00000000000000..4ff935d8a9b1bc --- /dev/null +++ b/vlib/v/tests/skip_unused/auto_string.run.out @@ -0,0 +1,3 @@ +Hello Tom +C->&Tom +&1.24 diff --git a/vlib/v/tests/skip_unused/auto_string.skip_unused.run.out b/vlib/v/tests/skip_unused/auto_string.skip_unused.run.out new file mode 100644 index 00000000000000..4ff935d8a9b1bc --- /dev/null +++ b/vlib/v/tests/skip_unused/auto_string.skip_unused.run.out @@ -0,0 +1,3 @@ +Hello Tom +C->&Tom +&1.24 diff --git a/vlib/v/tests/skip_unused/auto_string.vv b/vlib/v/tests/skip_unused/auto_string.vv new file mode 100644 index 00000000000000..cf10a93c77b34b --- /dev/null +++ b/vlib/v/tests/skip_unused/auto_string.vv @@ -0,0 +1,9 @@ +a := 'Tom' +b := 'Hello ${a}' +c := &a +println(b) +println('C->${c}') + +f := 1.24 +f_p := &f +println('${f_p}')