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 (
|
1 | const (
|
||||||
2 | Red = 1
|
2 | Red = 1
|
||||||
| ~~~
|
| ~~~
|
||||||
|
@ -3689,8 +3689,8 @@ fn (mut p Parser) const_decl() ast.ConstDecl {
|
|||||||
pos := p.tok.pos()
|
pos := p.tok.pos()
|
||||||
name := p.check_name()
|
name := p.check_name()
|
||||||
end_comments << p.eat_comments()
|
end_comments << p.eat_comments()
|
||||||
if util.contains_capital(name) {
|
if !p.pref.translated && !p.is_translated && util.contains_capital(name) {
|
||||||
p.warn_with_pos('const names cannot contain uppercase letters, use snake_case instead',
|
p.error_with_pos('const names cannot contain uppercase letters, use snake_case instead',
|
||||||
pos)
|
pos)
|
||||||
}
|
}
|
||||||
full_name := p.prepend_mod(name)
|
full_name := p.prepend_mod(name)
|
||||||
|
Loading…
Reference in New Issue
Block a user