]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/api: fix panic on exported basic type aliases
authorDevon H. O'Dell <dhobsd@google.com>
Thu, 4 Jan 2024 16:49:17 +0000 (11:49 -0500)
committerGopher Robot <gobot@golang.org>
Thu, 4 Jan 2024 17:31:12 +0000 (17:31 +0000)
commit15dcdeb5aacb4503e3d053f198bd4669d5cec2aa
tree2d10f68540a4ef6f4d017ae57993adfebc1f14d0
parent6db1102605f227093ea95538f0fe9e46022ad7ea
cmd/api: fix panic on exported basic type aliases

The order of emitting named type and type aliases in the `Walker`'s
`emitType` function is inverted. When the type alias references a basic
type, this causes a panic as the type assertion on `*types.Named` fails.
This change reorders the logic such that type aliases are emitted prior
to this type assertion.

Fixes #64958

Change-Id: I52dbe13999978912ded788d9cf4948103869bcfa
Reviewed-on: https://go-review.googlesource.com/c/go/+/554076
Reviewed-by: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
src/cmd/api/api_test.go
src/cmd/api/main_test.go
src/cmd/api/testdata/src/issue64958/p/p.go [new file with mode: 0644]