mirror of
https://github.com/golang/go
synced 2024-11-18 09:04:49 -07:00
go/parser: selectors may be method expressions
R=adonovan CC=golang-dev https://golang.org/cl/12062043
This commit is contained in:
parent
46437f0028
commit
340918a8a3
@ -1408,7 +1408,7 @@ L:
|
||||
}
|
||||
switch p.tok {
|
||||
case token.IDENT:
|
||||
x = p.parseSelector(p.checkExpr(x))
|
||||
x = p.parseSelector(p.checkExprOrType(x))
|
||||
case token.LPAREN:
|
||||
x = p.parseTypeAssertion(p.checkExpr(x))
|
||||
default:
|
||||
|
@ -34,6 +34,7 @@ var valids = []string{
|
||||
`package p; func f() { switch ; {} };`,
|
||||
`package p; func f() { for _ = range "foo" + "bar" {} };`,
|
||||
`package p; func f() { var s []int; g(s[:], s[i:], s[:j], s[i:j], s[i:j:k], s[:j:k]) };`,
|
||||
`package p; var ( _ = (struct {*T}).m; _ = (interface {T}).m )`,
|
||||
}
|
||||
|
||||
func TestValid(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user