]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.8] 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)
committerRuss Cox <rsc@golang.org>
Tue, 7 Feb 2017 16:51:22 +0000 (16:51 +0000)
commitc543cc353deb4cffe213be5b094c8357faecab07
tree96f7c1b517e5cf2214a67a271c9df333a1151085
parentf0749fe163ca4917f903ed424008af37e834ace4
[release-branch.go1.8] 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>
Reviewed-on: https://go-review.googlesource.com/36422
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/syntax/parser.go
test/fixedbugs/issue18915.go [new file with mode: 0644]