From a0d10a66065c6da345be062467f54369d2a6d39f Mon Sep 17 00:00:00 2001 From: joe-conigliaro Date: Fri, 11 Dec 2020 19:36:39 +1100 Subject: [PATCH] parser: enum_decl - remove redundant position variable --- vlib/v/parser/parser.v | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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