diff options
author | Josh Bleecher Snyder <josharian@gmail.com> | 2016-05-31 15:02:40 -0700 |
---|---|---|
committer | Josh Bleecher Snyder <josharian@gmail.com> | 2016-08-22 19:56:06 +0000 |
commit | cf20525bf414c8268d8fe111460767d52f03df44 (patch) | |
tree | f4d49b99b673764a18221276ee9452828da83eb8 /test/switch6.go | |
parent | 410974497365b2e6e23811dbc58475b00c69d0db (diff) | |
download | go-cf20525bf414c8268d8fe111460767d52f03df44.tar.gz go-cf20525bf414c8268d8fe111460767d52f03df44.zip |
cmd/compile: set correct line number for multiple defaults in switch error
Fixes #15911.
Change-Id: I500533484de61aa09abe4cecb010445e3176324e
Reviewed-on: https://go-review.googlesource.com/26760
TryBot-Result: Gobot Gobot <gobot@golang.org>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'test/switch6.go')
-rw-r--r-- | test/switch6.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/switch6.go b/test/switch6.go index bd62c620b6..32392d8f73 100644 --- a/test/switch6.go +++ b/test/switch6.go @@ -21,12 +21,12 @@ func f0(e error) { // Verify that the compiler rejects multiple default cases. func f1(e interface{}) { - switch e { // ERROR "multiple defaults in switch" - default: + switch e { default: + default: // ERROR "multiple defaults in switch" } - switch e.(type) { // ERROR "multiple defaults in switch" - default: + switch e.(type) { default: + default: // ERROR "multiple defaults in switch" } } |