Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: bad line number for duplicate default case #15911

Closed
josharian opened this issue May 31, 2016 · 2 comments
Closed

cmd/compile: bad line number for duplicate default case #15911

josharian opened this issue May 31, 2016 · 2 comments
Milestone

Comments

@josharian
Copy link
Contributor

func f(e interface{}) {
    switch e { // ERROR "multiple defaults in switch"
    default:
    default:
    }
    switch e.(type) { // ERROR "multiple defaults in switch"
    default:
    default:
    }
}

Those errors are on the wrong line. They should be on the second default line. The fix is trivial, just waiting for 1.8.

@josharian josharian added this to the Go1.8 milestone May 31, 2016
@josharian josharian self-assigned this May 31, 2016
josharian added a commit to josharian/go that referenced this issue May 31, 2016
…error

Fixes golang#15911.

Change-Id: I500533484de61aa09abe4cecb010445e3176324e
mk0x9 pushed a commit to mk0x9/go that referenced this issue May 31, 2016
Some of these errors are reported in the wrong places.
That’s issue golang#15911 and golang#15912.

Change-Id: Ia09d7f89be4d15f05217a542a61b6ac08090dd87
Reviewed-on: https://go-review.googlesource.com/23588
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
josharian added a commit to josharian/go that referenced this issue May 31, 2016
…error

Fixes golang#15911.

Change-Id: I500533484de61aa09abe4cecb010445e3176324e
josharian added a commit to josharian/go that referenced this issue Jun 17, 2016
…error

Fixes golang#15911.

Change-Id: I500533484de61aa09abe4cecb010445e3176324e
@gopherbot
Copy link

CL https://golang.org/cl/26760 mentions this issue.

@mdempsky
Copy link
Member

And for the record, go/types and gccgo emit the error message on the second default lines.

@golang golang locked and limited conversation to collaborators Aug 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants