1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen: array init fix;

This commit is contained in:
Alexander Medvednikov
2020-03-15 07:42:45 +01:00
parent 2d5c7c8e93
commit 8e2537a366
6 changed files with 15 additions and 13 deletions

View File

@ -76,7 +76,7 @@ fn (p mut Parser) struct_decl(generic_param_types []string) {
}
}
if name.len == 1 && !p.pref.building_v && !p.pref.is_repl {
p.warn('struct names must have more than one character')
p.warn('struct names must have more than one character ("$name", len=$name.len, $p.pref.building_v)')
}
if !is_c && !good_type_name(name) {
p.error('bad struct name, e.g. use `HttpRequest` instead of `HTTPRequest`')