case
// tokens that may start an expression
token.IDENT, token.INT, token.FLOAT, token.IMAG, token.CHAR, token.STRING, token.FUNC, token.LPAREN, // operands
- token.LBRACK, token.STRUCT, // composite types
+ token.LBRACK, token.STRUCT, token.MAP, token.CHAN, token.INTERFACE, // composite types
token.ADD, token.SUB, token.MUL, token.AND, token.XOR, token.ARROW, token.NOT: // unary operators
s, _ = p.parseSimpleStmt(labelOk)
// because of the required look-ahead, labeled statements are
`package p; func (*(T),) m() {}`,
`package p; func _(x []int) { for range x {} }`,
`package p; func _() { if [T{}.n]int{} {} }`,
+ `package p; func _() { map[int]int{}[0]++; map[int]int{}[0] += 1 }`,
+ `package p; func _(x interface{f()}) { interface{f()}(x).f() }`,
+ `package p; func _(x chan int) { chan int(x) <- 0 }`,
}
func TestValid(t *testing.T) {