mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: fix receiver pos for single letter type error message (#8393)
This commit is contained in:
parent
1a29719f16
commit
0afe36e153
@ -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) {
|
||||
|
@ -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 |
|
||||
|
Loading…
Reference in New Issue
Block a user