diff --git a/vlib/v/parser/parser.v b/vlib/v/parser/parser.v index ad302a7753..a1c781e83c 100644 --- a/vlib/v/parser/parser.v +++ b/vlib/v/parser/parser.v @@ -1890,7 +1890,6 @@ fn (mut p Parser) enum_decl() ast.EnumDecl { } p.check(.key_enum) end_pos := p.tok.position() - name_pos := p.tok.position() enum_name := p.check_name() if enum_name.len == 1 { p.error_with_pos('single letter capital names are reserved for generic template types.', @@ -1962,7 +1961,7 @@ $pubfn (mut e $enum_name) toggle(flag $enum_name) { unsafe{ *e = int(*e) ^ ( }) if idx == -1 { p.error_with_pos('cannot register enum `$name`, another type with this name exists', - name_pos) + end_pos) } return ast.EnumDecl{ name: name