mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
This commit is contained in:
parent
87dd5de191
commit
045adb6600
@ -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
|
||||
| ~~~
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user