mirror of
https://gitee.com/wa-lang/wa.git
synced 2025-12-06 17:19:15 +08:00
修复格式化结构体匿名嵌入成员在类型前打印冒号的问题
This commit is contained in:
@@ -18,3 +18,18 @@ func ExampleFormatCode() {
|
||||
// Output:
|
||||
// func add(a: i32, b: i32) => i32 { return a + b }
|
||||
}
|
||||
|
||||
func ExampleFormatCode_structEmbeddingField() {
|
||||
s, err := api.FormatCode("hello.wa", `
|
||||
type A :struct{ }
|
||||
type B :struct{ A }
|
||||
`)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Println(s)
|
||||
|
||||
// Output:
|
||||
// type A :struct{}
|
||||
// type B :struct{ A }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user