mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
This commit is contained in:
@@ -290,8 +290,9 @@ pub fn (mut c Checker) struct_init(mut node ast.StructInit) ast.Type {
|
||||
&& c.table.cur_concrete_types.len == 0 {
|
||||
pos := type_sym.name.last_index('.') or { -1 }
|
||||
first_letter := type_sym.name[pos + 1]
|
||||
if !first_letter.is_capital() && type_sym.kind != .placeholder
|
||||
&& !type_sym.name.starts_with('main._VAnonStruct') {
|
||||
if !first_letter.is_capital()
|
||||
&& (type_sym.kind != .struct_ || !(type_sym.info as ast.Struct).is_anon)
|
||||
&& type_sym.kind != .placeholder {
|
||||
c.error('cannot initialize builtin type `$type_sym.name`', node.pos)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user