checker: temporary c2v struct init fix

master
Alexander Medvednikov 2022-06-16 14:24:17 +03:00
parent df239b9208
commit 9c72b85f72
1 changed files with 2 additions and 1 deletions

View File

@ -321,7 +321,8 @@ pub fn (mut c Checker) struct_init(mut node ast.StructInit) ast.Type {
if node.is_short { if node.is_short {
exp_len := info.fields.len exp_len := info.fields.len
got_len := node.fields.len got_len := node.fields.len
if exp_len != got_len { if exp_len != got_len && !c.pref.translated {
// XTODO remove !translated check
amount := if exp_len < got_len { 'many' } else { 'few' } amount := if exp_len < got_len { 'many' } else { 'few' }
c.error('too $amount fields in `$type_sym.name` literal (expecting $exp_len, got $got_len)', c.error('too $amount fields in `$type_sym.name` literal (expecting $exp_len, got $got_len)',
node.pos) node.pos)