diff --git a/vlib/v/ast/table.v b/vlib/v/ast/table.v index 74b018fdc7..46280b7126 100644 --- a/vlib/v/ast/table.v +++ b/vlib/v/ast/table.v @@ -219,7 +219,7 @@ pub fn (t &Table) fn_type_signature(f &Fn) string { } else { sig += arg_type_sym.str().to_lower().replace_each(['.', '__', '&', '', '[', 'arr_', 'chan ', 'chan_', 'map[', 'map_of_', ']', '_to_', '<', '_T_', ',', '_', ' ', '', - '>', '']) + '>', '', '(', '_', ')', '_']) } if i < f.params.len - 1 { sig += '_' diff --git a/vlib/v/tests/anon_fn_with_nested_anon_fn_args_test.v b/vlib/v/tests/anon_fn_with_nested_anon_fn_args_test.v new file mode 100644 index 0000000000..0e36c68b54 --- /dev/null +++ b/vlib/v/tests/anon_fn_with_nested_anon_fn_args_test.v @@ -0,0 +1,12 @@ +module main + +fn test_anon_fn_with_nested_anon_fn_args() { + mut xa := fn (x fn (int) string, y int) string { + return x(y) + } + a := xa(fn (i int) string { + return 'a' + i.str() + }, 8) + println(a) + assert a == 'a8' +}