Skip to content

Commit 637ce20

Browse files
authored
fmt: fix import selective with interface implements (fix formatting part of #22200) (#22209)
1 parent 747f3b3 commit 637ce20

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

vlib/v/fmt/struct.v

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ pub fn (mut f Fmt) struct_decl(node ast.StructDecl, is_anon bool) {
3838
if i < node.implements_types.len - 1 {
3939
f.write(', ')
4040
}
41+
f.mark_types_import_as_used(t)
4142
}
4243
}
4344
// Calculate the alignments first
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import v.ast.walker { Visitor }
2+
import v.ast { Node }
3+
4+
struct Walker implements Visitor {
5+
aaa string
6+
}
7+
8+
fn (mut n Walker) visit(node &Node) ! {
9+
panic('not implemented')
10+
}

0 commit comments

Comments
 (0)