diff options
author | Robert Griesemer <gri@golang.org> | 2024-02-22 11:00:31 -0800 |
---|---|---|
committer | Gopher Robot <gobot@golang.org> | 2024-02-22 19:32:17 +0000 |
commit | db57e5a040922c9cd1dac26ebc0b48f310f84095 (patch) | |
tree | f335271a0156c67f5a955eb57567bc253d0ac158 /src/go/types/predicates.go | |
parent | f278f756bdd1613fdedc74a8b59ccf048afab979 (diff) | |
download | go-db57e5a040922c9cd1dac26ebc0b48f310f84095.tar.gz go-db57e5a040922c9cd1dac26ebc0b48f310f84095.zip |
go/types, types2: remove unreachable func (minor cleanup)
In some places we can't use unreachable() because it does
not terminate control flow and we need to resort to panic.
Be consistent and just use panic("unreachable") everywhere.
This also opens the door to reporting more specific panic
messages.
Mechanical change: s/unreachable()/panic("unreachable")/
Minor cleanup for better consistency.
Change-Id: I6b52af7c21dcfaa1ca19839d14040552db5d4cb4
Reviewed-on: https://go-review.googlesource.com/c/go/+/566135
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src/go/types/predicates.go')
-rw-r--r-- | src/go/types/predicates.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/go/types/predicates.go b/src/go/types/predicates.go index 677dff01a0..e1a32143f1 100644 --- a/src/go/types/predicates.go +++ b/src/go/types/predicates.go @@ -479,7 +479,7 @@ func (c *comparer) identical(x, y Type, p *ifacePair) bool { // avoid a crash in case of nil type default: - unreachable() + panic("unreachable") } return false |