diff --git a/vlib/v/checker/tests/const_field_name_snake_case.out b/vlib/v/checker/tests/const_field_name_snake_case.out index ff997e441d..352ff4bf68 100644 --- a/vlib/v/checker/tests/const_field_name_snake_case.out +++ b/vlib/v/checker/tests/const_field_name_snake_case.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/const_field_name_snake_case.vv:2:2: warning: const names cannot contain uppercase letters, use snake_case instead +vlib/v/checker/tests/const_field_name_snake_case.vv:2:2: error: const names cannot contain uppercase letters, use snake_case instead 1 | const ( 2 | Red = 1 | ~~~ diff --git a/vlib/v/parser/parser.v b/vlib/v/parser/parser.v index 4bba5147c1..ec37d71e22 100644 --- a/vlib/v/parser/parser.v +++ b/vlib/v/parser/parser.v @@ -3689,8 +3689,8 @@ fn (mut p Parser) const_decl() ast.ConstDecl { pos := p.tok.pos() name := p.check_name() end_comments << p.eat_comments() - if util.contains_capital(name) { - p.warn_with_pos('const names cannot contain uppercase letters, use snake_case instead', + if !p.pref.translated && !p.is_translated && util.contains_capital(name) { + p.error_with_pos('const names cannot contain uppercase letters, use snake_case instead', pos) } full_name := p.prepend_mod(name)