]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/syntax: make a parser error "1.7 compliant"
authorRobert Griesemer <gri@golang.org>
Mon, 6 Feb 2017 23:08:28 +0000 (15:08 -0800)
committerRobert Griesemer <gri@golang.org>
Mon, 6 Feb 2017 23:33:07 +0000 (23:33 +0000)
commit3b68a647696ebfb61d199155f5f1faa5740e5c55
tree07bc1ecd423b0a9025a7384c27774138603846a2
parent6a29440dcc5b71ded72d35e00a26d96c401f49d4
cmd/compile/internal/syntax: make a parser error "1.7 compliant"

For code such as

if a := 10 { ...

the 1.7 compiler reported

a := 10 used as value

while the 1.8 compiler reported

invalid condition, tag, or type switch guard

Changed the error message to match the 1.7 compiler.

Fixes #18915.

Change-Id: I01308862e461922e717f9f8295a9db53d5a914eb
Reviewed-on: https://go-review.googlesource.com/36470
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/syntax/parser.go
test/fixedbugs/issue18915.go [new file with mode: 0644]