Skip to content

Commit 21f207e

Browse files
committed
v.checker: use more concise error messages (remove please)
1 parent a9eb893 commit 21f207e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

vlib/v/checker/checker.v

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4261,7 +4261,7 @@ fn (mut c Checker) hash_stmt(mut node ast.HashStmt) {
42614261
node.pos)
42624262
}
42634263
if c.mod == 'main' {
4264-
c.error('hash statements are not allowed in the main module. Please place them in a separate module.',
4264+
c.error('hash statements are not allowed in the main module. Place them in a separate module.',
42654265
node.pos)
42664266
}
42674267
return
@@ -4757,10 +4757,10 @@ pub fn (mut c Checker) cast_expr(mut node ast.CastExpr) ast.Type {
47574757
expr_is_ptr := node.expr_type.is_ptr() || n_e_t_idx in ast.pointer_type_idxs
47584758
if expr_is_ptr && to_type_sym.kind == .string && !node.in_prexpr {
47594759
if node.has_arg {
4760-
c.warn('to convert a C string buffer pointer to a V string, please use x.vstring_with_len(len) instead of string(x,len)',
4760+
c.warn('to convert a C string buffer pointer to a V string, use x.vstring_with_len(len) instead of string(x,len)',
47614761
node.pos)
47624762
} else {
4763-
c.warn('to convert a C string buffer pointer to a V string, please use x.vstring() instead of string(x)',
4763+
c.warn('to convert a C string buffer pointer to a V string, use x.vstring() instead of string(x)',
47644764
node.pos)
47654765
}
47664766
}
@@ -6035,7 +6035,7 @@ fn (mut c Checker) comp_if_branch(cond ast.Expr, pos token.Position) bool {
60356035
}
60366036
} else if cond.name !in c.pref.compile_defines_all {
60376037
if cond.name == 'linux_or_macos' {
6038-
c.error('linux_or_macos is deprecated, please use `\$if linux || macos {` instead',
6038+
c.error('linux_or_macos is deprecated, use `\$if linux || macos {` instead',
60396039
cond.pos)
60406040
return false
60416041
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
vlib/v/checker/tests/warnings_for_string_c2v_calls.vv:8:7: error: to convert a C string buffer pointer to a V string, please use x.vstring() instead of string(x)
1+
vlib/v/checker/tests/warnings_for_string_c2v_calls.vv:8:7: error: to convert a C string buffer pointer to a V string, use x.vstring() instead of string(x)
22
6 | p[2] = `z`
33
7 | }
44
8 | x := string(p)
55
| ~~~~~~~~~
66
9 | y := string(p, 10)
77
10 | eprintln('x: $x | y: $y')
8-
vlib/v/checker/tests/warnings_for_string_c2v_calls.vv:9:7: error: to convert a C string buffer pointer to a V string, please use x.vstring_with_len(len) instead of string(x,len)
8+
vlib/v/checker/tests/warnings_for_string_c2v_calls.vv:9:7: error: to convert a C string buffer pointer to a V string, use x.vstring_with_len(len) instead of string(x,len)
99
7 | }
1010
8 | x := string(p)
1111
9 | y := string(p, 10)
1212
| ~~~~~~~~~~~~~
1313
10 | eprintln('x: $x | y: $y')
14-
11 | eprintln('x.len: $x.len | y.len: $y.len')
14+
11 | eprintln('x.len: $x.len | y.len: $y.len')

0 commit comments

Comments
 (0)