@@ -51,7 +51,7 @@ fn (mut g Gen) spawn_and_go_expr(node ast.SpawnExpr, mode SpawnGoMode) {
5151 } else if mut expr.left is ast.AnonFn {
5252 if expr.left.inherited_vars.len > 0 {
5353 fn_var := g.fn_var_signature (expr.left.decl.return_type, expr.left.decl.params.map (it .typ),
54- tmp_fn)
54+ tmp_fn, 0 )
5555 g.write ('\t ${fn_var } = ' )
5656 g.gen_anon_fn (mut expr.left)
5757 g.writeln (';' )
@@ -65,7 +65,8 @@ fn (mut g Gen) spawn_and_go_expr(node ast.SpawnExpr, mode SpawnGoMode) {
6565 if expr.is_fn_var {
6666 fn_sym := g.table.sym (expr.fn_var_type)
6767 func := (fn_sym.info as ast.FnType ).func
68- fn_var := g.fn_var_signature (func.return_type, func.params.map (it .typ), tmp_fn)
68+ fn_var := g.fn_var_signature (func.return_type, func.params.map (it .typ), tmp_fn,
69+ 0 )
6970 g.write ('\t ${fn_var } = ' )
7071 g.expr (expr.left)
7172 g.writeln (';' )
@@ -185,10 +186,10 @@ fn (mut g Gen) spawn_and_go_expr(node ast.SpawnExpr, mode SpawnGoMode) {
185186 fn_sym := g.table.sym (node.call_expr.fn_var_type)
186187 info := fn_sym.info as ast.FnType
187188 fn_var = g.fn_var_signature (info.func.return_type, info.func.params.map (it .typ),
188- 'fn' )
189+ 'fn' , 0 )
189190 } else if node.call_expr.left is ast.AnonFn {
190191 f := node.call_expr.left.decl
191- fn_var = g.fn_var_signature (f.return_type, f.params.map (it .typ), 'fn' )
192+ fn_var = g.fn_var_signature (f.return_type, f.params.map (it .typ), 'fn' , 0 )
192193 } else {
193194 if node.call_expr.is_method {
194195 rec_sym := g.table.sym (g.unwrap_generic (node.call_expr.receiver_type))
@@ -199,7 +200,7 @@ fn (mut g Gen) spawn_and_go_expr(node ast.SpawnExpr, mode SpawnGoMode) {
199200 mut arg_types := f.params.map (it .typ)
200201 arg_types = arg_types.map (muttable.convert_generic_type (it , f.generic_names,
201202 node.call_expr.concrete_types) or { it })
202- fn_var = g.fn_var_signature (return_type, arg_types, 'fn' )
203+ fn_var = g.fn_var_signature (return_type, arg_types, 'fn' , 0 )
203204 }
204205 } else {
205206 if f := g.table.find_fn (node.call_expr.name) {
@@ -222,7 +223,7 @@ fn (mut g Gen) spawn_and_go_expr(node ast.SpawnExpr, mode SpawnGoMode) {
222223 }
223224 }
224225 }
225- fn_var = g.fn_var_signature (return_type, arg_types, 'fn' )
226+ fn_var = g.fn_var_signature (return_type, arg_types, 'fn' , 0 )
226227 }
227228 }
228229 }
@@ -238,7 +239,7 @@ fn (mut g Gen) spawn_and_go_expr(node ast.SpawnExpr, mode SpawnGoMode) {
238239 arg_sym := g.table.sym (arg.typ)
239240 if arg_sym.info is ast.FnType {
240241 sig := g.fn_var_signature (arg_sym.info.func.return_type, arg_sym.info.func.params.map (it .typ),
241- 'arg${i + 1 }' )
242+ 'arg${i + 1 }' , arg.typ. nr_muls () )
242243 g.type_definitions.writeln ('\t ' + sig + ';' )
243244 } else {
244245 styp := g.styp (arg.typ)
0 commit comments