You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
funcf4(einterface{}) {
switche.(type) {
caseint:
caseint: // ERROR "duplicate case int in type switch"caseint64:
caseerror: // ERROR "duplicate case error in type switch"caseerror:
case fmt.Stringer:
case fmt.Stringer: // ERROR "duplicate case fmt.Stringer in type switch"casestruct {
iint"tag1"
}:
casestruct {
iint"tag2"
}:
casestruct {
iint"tag1"
}: // ERROR "duplicate case struct { i int .tag1. } in type switch"
}
}
The error for case error occurs on the first case error, not the second. Removing the final three struct cases moves the error line back to where it belongs.
The text was updated successfully, but these errors were encountered:
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>
This is a bit simpler than playing sorting games,
and it is clearer that it generates errors
in the correct (source) order.
It also allows us to simplify sorting.
While we’re here, refactoring deduping into separate functions.
Negligible compilebench impact.
Fixesgolang#15912.
Change-Id: I6cc19edd38875389a70ccbdbdf0d9b7d5ac5946f
This is a bit simpler than playing sorting games,
and it is clearer that it generates errors
in the correct (source) order.
It also allows us to simplify sorting.
While we’re here, refactoring deduping into separate functions.
Negligible compilebench impact.
Fixesgolang#15912.
Change-Id: I6cc19edd38875389a70ccbdbdf0d9b7d5ac5946f
The error for
case error
occurs on the first case error, not the second. Removing the final three struct cases moves the error line back to where it belongs.The text was updated successfully, but these errors were encountered: