ast: fix fixed array typedef generation issue (#11962)
parent
c75271fcb7
commit
400ab7876b
|
@ -207,7 +207,7 @@ pub fn (t &Table) fn_type_signature(f &Fn) string {
|
||||||
// TODO: for now ignore mut/pts in sig for now
|
// TODO: for now ignore mut/pts in sig for now
|
||||||
typ := arg.typ.set_nr_muls(0)
|
typ := arg.typ.set_nr_muls(0)
|
||||||
arg_type_sym := t.get_type_symbol(typ)
|
arg_type_sym := t.get_type_symbol(typ)
|
||||||
sig += arg_type_sym.str().to_lower().replace_each(['.', '__', '&', '', '[]', 'arr_', 'chan ',
|
sig += arg_type_sym.str().to_lower().replace_each(['.', '__', '&', '', '[', 'arr_', 'chan ',
|
||||||
'chan_', 'map[', 'map_of_', ']', '_to_', '<', '_T_', ',', '_', ' ', '', '>', ''])
|
'chan_', 'map[', 'map_of_', ']', '_to_', '<', '_T_', ',', '_', ' ', '', '>', ''])
|
||||||
if i < f.params.len - 1 {
|
if i < f.params.len - 1 {
|
||||||
sig += '_'
|
sig += '_'
|
||||||
|
|
|
@ -1,3 +1,15 @@
|
||||||
|
struct Test {
|
||||||
|
fn_test fn (x int, y [10]int, z []int) bool = fixed_array_fn
|
||||||
|
}
|
||||||
|
|
||||||
|
fn fixed_array_fn(x int, y [10]int, z []int) bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
fn test_anon_fn_with_fixed_array_arguments() {
|
||||||
|
assert true
|
||||||
|
}
|
||||||
|
|
||||||
fn fn_arg(f fn ([]int) int) int {
|
fn fn_arg(f fn ([]int) int) int {
|
||||||
return f([1, 2, 3])
|
return f([1, 2, 3])
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue