From 9c72b85f728e2b8daf2427ab30f591d93e5a3ff0 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Thu, 16 Jun 2022 14:24:17 +0300 Subject: [PATCH] checker: temporary c2v struct init fix --- vlib/v/checker/struct.v | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vlib/v/checker/struct.v b/vlib/v/checker/struct.v index c410bb04cb..6a67102991 100644 --- a/vlib/v/checker/struct.v +++ b/vlib/v/checker/struct.v @@ -321,7 +321,8 @@ pub fn (mut c Checker) struct_init(mut node ast.StructInit) ast.Type { if node.is_short { exp_len := info.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' } c.error('too $amount fields in `$type_sym.name` literal (expecting $exp_len, got $got_len)', node.pos)