]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/syntax: more strict parsing of type instances
authorRobert Griesemer <gri@golang.org>
Wed, 31 Aug 2022 22:54:28 +0000 (15:54 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 2 Sep 2022 02:14:57 +0000 (02:14 +0000)
commit1be8fcdcdce01ca7cffb1fd90c1cd706c3ea4ee4
tree6f1b66c697ed495b831af265532b80be6f3528eb
parentd98bf7d0151c3feeceba6348519bb5c16e8ddc3f
cmd/compile/internal/syntax: more strict parsing of type instances

Report a syntax error if the first element of a type instance is
not actually a type (but some other expression), rather then relying
on the type checker error in this case. This matches the behavior of
go/parser. Adjust the corresponding types2 test case.

For #54511.

Change-Id: Ia82b3a7d444738c56955ce6c15609470b3431fd1
Reviewed-on: https://go-review.googlesource.com/c/go/+/426657
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/compile/internal/syntax/parser.go
src/cmd/compile/internal/types2/testdata/fixedbugs/issue48827.go