| 1 |
This test checks completion of nested composite literals; |
| 2 |
|
| 3 |
Parser recovery changed in Go 1.20, so this test requires at least that |
| 4 |
version for consistency. |
| 5 |
|
| 6 |
-- flags -- |
| 7 |
-ignore_extra_diags |
| 8 |
|
| 9 |
-- nested_complit.go -- |
| 10 |
package nested_complit |
| 11 |
|
| 12 |
type ncFoo struct {} //@item(structNCFoo, "ncFoo", "struct{...}", "struct") |
| 13 |
|
| 14 |
type ncBar struct { //@item(structNCBar, "ncBar", "struct{...}", "struct") |
| 15 |
baz []ncFoo |
| 16 |
} |
| 17 |
|
| 18 |
func _() { |
| 19 |
_ = []ncFoo{} //@item(litNCFoo, "[]ncFoo{}", "", "var") |
| 20 |
_ = make([]ncFoo, 0) //@item(makeNCFoo, "make([]ncFoo, 0)", "", "func") |
| 21 |
|
| 22 |
_ := ncBar{ |
| 23 |
baz: [] //@complete(re"() \\/\\/", litNCFoo, makeNCFoo, structNCBar, structNCFoo) |
| 24 |
} |
| 25 |
} |