cmd/compile: use a map to detect duplicate type switch cases
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. It also prevents quadratic error messages for (pathological) inputs with many duplicate type cases. While we’re here, refactoring deduping into separate functions. Negligible compilebench impact. Fixes #15912. Change-Id: I6cc19edd38875389a70ccbdbdf0d9b7d5ac5946f Reviewed-on: https://go-review.googlesource.com/26762 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Showing
Please
register
or
sign in
to comment