Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: reflect.Type does not implement comparable #53249

Closed
limpo1989 opened this issue Jun 6, 2022 · 1 comment
Closed

cmd/compile: reflect.Type does not implement comparable #53249

limpo1989 opened this issue Jun 6, 2022 · 1 comment

Comments

@limpo1989
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.18.2 windows/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
et GO111MODULE=on
set GOARCH=amd64
set GOBIN=      
set GOCACHE=C:\Users\Administrator\AppData\Local\go-build
set GOENV=C:\Users\Administrator\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=D:\gomod\pkg\mod
set GONOPROXY=***
set GONOSUMDB=***
set GOOS=windows
set GOPATH=D:\gomod;C:\Users\Administrator\go
set GOPRIVATE=git.idianhun.com,git.dianhun.cn
set GOPROXY=https://goproxy.io,direct
set GOROOT=D:\Go
set GOSUMDB=off
set GOTMPDIR=
set GOTOOLDIR=D:\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.18.2
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=*********\example\go.mod
set GOWORK=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\ADMINI~1\AppData\Local\Temp\go-build1029863356=/tmp/go-build -gno-record-gcc-switches

What did you do?

https://go.dev/play/p/wSisCGgWwUg

// You can edit this code!
// Click here and start typing.
package main

import (
	"fmt"
	"reflect"

	"golang.org/x/exp/maps"
)

func main() {
	var types = make(map[reflect.Type]int)
	fmt.Println(maps.Keys(types))
}

What did you expect to see?

compiled successfully

What did you see instead?

./prog.go:14:23: reflect.Type does not implement comparable

Go build failed.

@seankhliao
Copy link
Member

Duplicate of #52509 and others

@golang golang locked and limited conversation to collaborators Jun 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants