fmt: do not remove chan type of struct fields (#8948)
parent
1c0eefae38
commit
e53476d5e1
|
@ -666,7 +666,7 @@ pub fn (mut f Fmt) struct_decl(node ast.StructDecl) {
|
|||
mut field_types := []string{cap: node.fields.len}
|
||||
for i, field in node.fields {
|
||||
mut ft := f.no_cur_mod(f.table.type_to_str(field.typ))
|
||||
if !ft.contains('C.') && !ft.contains('JS.') && !ft.contains('fn (') {
|
||||
if !ft.contains('C.') && !ft.contains('JS.') && !ft.contains('fn (') && !ft.contains('chan') {
|
||||
ft = f.short_module(ft)
|
||||
}
|
||||
field_types << ft
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
import some_mod
|
||||
|
||||
struct ChanFieldType {
|
||||
c chan some_mod.Type
|
||||
}
|
||||
|
||||
struct FSMEvent {
|
||||
x int
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue