Skip to content

reflect: Type interface is unimplemented comparable (generics) #51179

Closed as not planned
@Code-Hex

Description

@Code-Hex

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

$ gotip version
go version devel go1.18-e50f0f372b Fri Feb 11 05:11:58 2022 +0000 darwin/arm64

What did you do?

The document for reflect.Type interface has described is comparable.

Type values are comparable, such as with the == operator, so they can be used as map keys.

However, I tried to compare with a function using generics comparable, and I get a compilation error.

What did you expect to see?

compilable

What did you see instead?

compilation error.

https://go.dev/play/p/vPcBpD86rST?v=gotip

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.genericsIssue is related to generics

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions