mirror of
https://github.com/golang/go
synced 2024-11-25 08:07:57 -07:00
1284cc2495
When a fully instantiated generic method is exported, be sure to also export the types in its signature. Fixes #52279. Change-Id: Icc6bca05b01f914cf67faaf1bf184eaa5484f521 Reviewed-on: https://go-review.googlesource.com/c/go/+/405118 Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
24 lines
321 B
Go
24 lines
321 B
Go
package lib
|
|
|
|
type FMap[K comparable, V comparable] map[K]V
|
|
|
|
//go:noinline
|
|
func (m FMap[K, V]) Flip() FMap[V, K] {
|
|
out := make(FMap[V, K])
|
|
return out
|
|
}
|
|
|
|
type MyType uint8
|
|
|
|
const (
|
|
FIRST MyType = 0
|
|
)
|
|
|
|
var typeStrs = FMap[MyType, string]{
|
|
FIRST: "FIRST",
|
|
}
|
|
|
|
func (self MyType) String() string {
|
|
return typeStrs[self]
|
|
}
|