diff --git a/vlib/v/fmt/fmt.v b/vlib/v/fmt/fmt.v index f10e93b8f7..fc91352e42 100644 --- a/vlib/v/fmt/fmt.v +++ b/vlib/v/fmt/fmt.v @@ -249,7 +249,7 @@ pub fn (mut f Fmt) short_module(name string) string { } } if aname == '' { - return symname + return '$tprefix$symname' } return '$tprefix${aname}.$symname' } diff --git a/vlib/v/fmt/tests/generic_struct_init_keep.vv b/vlib/v/fmt/tests/generic_struct_init_keep.vv new file mode 100644 index 0000000000..8dcccf0074 --- /dev/null +++ b/vlib/v/fmt/tests/generic_struct_init_keep.vv @@ -0,0 +1,9 @@ +module x + +struct Ok { + foo []T +} + +fn test_fmt() { + r := Ok<[]Token>{[]} +}