1
0
mirror of https://github.com/golang/go synced 2024-11-17 12:24:51 -07:00
go/test/fixedbugs/issue52279.dir/lib.go
David Chase 1284cc2495 cmd/compile: be sure to export types mentioned in f.i.g. method signature
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>
2022-05-10 19:15:31 +00:00

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]
}