Closed YoshikiShibata closed 4 years ago
T
should be comparable
package main
import "fmt"
type Foo(type T comparable) struct {
}
func (f *Foo(T)) bar() {
seen := make(map[T]bool)
fmt.Printf("seen: %T\n", seen)
}
func main() {
f := &Foo(int){}
f.bar()
}
@tdakkota is right. I don't see a bug here.
I see. Thanks!
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
N/A
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I tried to create a map of which key is a type parameter of a generic type.
What did you expect to see?
Can compile
What did you see instead?