Commit 340918a8 authored by Robert Griesemer's avatar Robert Griesemer

go/parser: selectors may be method expressions

R=adonovan
CC=golang-dev
https://golang.org/cl/12062043
parent 46437f00
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment