diff --git a/vlib/v/checker/struct.v b/vlib/v/checker/struct.v index 42d158b435..779274d8bf 100644 --- a/vlib/v/checker/struct.v +++ b/vlib/v/checker/struct.v @@ -51,7 +51,7 @@ pub fn (mut c Checker) struct_decl(mut node ast.StructDecl) { if field.typ != 0 { if !field.typ.is_ptr() { if c.table.unaliased_type(field.typ) == struct_typ_idx { - c.error('Field `$field.name` is part of `$node.name`, they can not both have the same type', + c.error('field `$field.name` is part of `$node.name`, they can not both have the same type', field.type_pos) } } diff --git a/vlib/v/checker/tests/field_can_not_be_from_the_same_type_as_containing_struct.out b/vlib/v/checker/tests/field_can_not_be_from_the_same_type_as_containing_struct.out index 6058fd0263..26ceecc4f7 100644 --- a/vlib/v/checker/tests/field_can_not_be_from_the_same_type_as_containing_struct.out +++ b/vlib/v/checker/tests/field_can_not_be_from_the_same_type_as_containing_struct.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/field_can_not_be_from_the_same_type_as_containing_struct.vv:5:9: error: Field `field` is part of `Bar`, they can not both have the same type +vlib/v/checker/tests/field_can_not_be_from_the_same_type_as_containing_struct.vv:5:9: error: field `field` is part of `Bar`, they can not both have the same type 3 | struct Bar { 4 | pfield &Foo = 0 5 | field Foo = Bar{}