mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parent
fb685eee18
commit
844662e0d6
@ -489,7 +489,7 @@ fn (mut g Gen) gen_str_for_struct(info ast.Struct, styp string, str_fn_name stri
|
|||||||
// TODO: this is a bit hacky. styp shouldn't be even parsed with _T_
|
// TODO: this is a bit hacky. styp shouldn't be even parsed with _T_
|
||||||
// use something different than g.typ for styp
|
// use something different than g.typ for styp
|
||||||
clean_struct_v_type_name =
|
clean_struct_v_type_name =
|
||||||
clean_struct_v_type_name.replace('_Array', '_array').replace('_T_', '<').replace('_', ', ') +
|
clean_struct_v_type_name.replace('Array_', '[]').replace('_T_', '<').replace('_', ', ') +
|
||||||
'>'
|
'>'
|
||||||
}
|
}
|
||||||
clean_struct_v_type_name = util.strip_main_name(clean_struct_v_type_name)
|
clean_struct_v_type_name = util.strip_main_name(clean_struct_v_type_name)
|
||||||
|
@ -342,7 +342,7 @@ fn test_generic_struct_print_array_as_field() {
|
|||||||
foo := Foo<[]string>{
|
foo := Foo<[]string>{
|
||||||
data: []string{}
|
data: []string{}
|
||||||
}
|
}
|
||||||
assert foo.str() == 'Foo<array, string>{\n data: []\n}'
|
assert foo.str() == 'Foo<[]string>{\n data: []\n}'
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user