mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: fix dup const test
This commit is contained in:
@@ -1888,7 +1888,7 @@ fn (mut c Checker) stmt(node ast.Stmt) {
|
|||||||
for i, field in node.fields {
|
for i, field in node.fields {
|
||||||
// TODO Check const name once the syntax is decided
|
// TODO Check const name once the syntax is decided
|
||||||
if field.name in c.const_names {
|
if field.name in c.const_names {
|
||||||
c.error('duplciate const `$field.name`', field.pos)
|
c.error('duplicate const `$field.name`', field.pos)
|
||||||
}
|
}
|
||||||
c.const_names << field.name
|
c.const_names << field.name
|
||||||
field_names << field.name
|
field_names << field.name
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
vlib/v/checker/tests/const_field_name_duplicate_err.v:3:2: error: field name `aaa` duplicate
|
vlib/v/checker/tests/const_field_name_duplicate_err.v:3:2: error: duplicate const `aaa`
|
||||||
1 | const (
|
1 | const (
|
||||||
2 | aaa = 1
|
2 | aaa = 1
|
||||||
3 | aaa = 2
|
3 | aaa = 2
|
||||||
|
Reference in New Issue
Block a user