]> Cypherpunks repositories - gostls13.git/commit
[dev.typeparams] cmd/compile/internal/types2: add Config.IgnoreBranches flag
authorRobert Griesemer <gri@golang.org>
Tue, 1 Dec 2020 20:18:20 +0000 (12:18 -0800)
committerRobert Griesemer <gri@golang.org>
Tue, 1 Dec 2020 21:49:40 +0000 (21:49 +0000)
commitbdc4ffe9a86d1dae0fef9de8395850e5c0b391c6
treeeae7931ab3b4e5d6ed3388c4f9ad3069ce93aebc
parent72ad2f44eaf8bb71ea100fd4acf7dd04384c7175
[dev.typeparams] cmd/compile/internal/types2: add Config.IgnoreBranches flag

If the new Config.IgnoreBranches flag is set, the typechecker
ignores errors due to misplaced labels, break, continue,
fallthrough, or goto statements.

Since the syntax parser already checks these errors, we need
to disable a 2nd check by the typechecker to avoid duplicate
errors when running the compiler with the new typechecker.

Adjusted test/run.go to not ignore some of the tests that
used to fail because of duplicate errors.

Change-Id: I8756eb1d44f67afef5e57da289cd604b8e1716db
Reviewed-on: https://go-review.googlesource.com/c/go/+/274612
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
src/cmd/compile/internal/gc/noder.go
src/cmd/compile/internal/types2/api.go
src/cmd/compile/internal/types2/stmt.go
test/run.go