diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index bf886293ef..8cd50f8b15 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -5287,7 +5287,7 @@ fn (mut c Checker) fn_decl(mut node ast.FnDecl) { } if sym.name.len == 1 { // One letter types are reserved for generics. - c.error('unknown type `$sym.name`', node.pos) + c.error('unknown type `$sym.name`', node.receiver_pos) return } // if sym.has_method(node.name) { diff --git a/vlib/v/checker/tests/receiver_unknown_type_single_letter.out b/vlib/v/checker/tests/receiver_unknown_type_single_letter.out index bd78937087..40e356eff7 100644 --- a/vlib/v/checker/tests/receiver_unknown_type_single_letter.out +++ b/vlib/v/checker/tests/receiver_unknown_type_single_letter.out @@ -1,3 +1,4 @@ vlib/v/checker/tests/receiver_unknown_type_single_letter.vv:1:5: error: unknown type `A` 1 | fn (p A) foo() {} | ~~~ + 2 |