]> Cypherpunks repositories - gostls13.git/commit
go/parser: leave checking of LHS in short var decls to type checker
authorRobert Griesemer <gri@golang.org>
Mon, 29 Aug 2022 22:45:35 +0000 (15:45 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 1 Sep 2022 23:18:06 +0000 (23:18 +0000)
commit1280ae7856d5226a7a4135621a6292240faa7657
treec96ec3fbfbbd5d2e511b18a1899c2378886ef276
parenta74d46d8ff44abe409282bf1a9a9ab1b0b2cdaa0
go/parser: leave checking of LHS in short var decls to type checker

Instead of checking at parse-time that the LHS of a short variable
declaration contains only identifiers, leave the check to the the
type checker which tests this already.

This removes a duplicate error and matches the behavior of the
syntax package.

For #54511.

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