Skip to content

go/types, types2: confusing error message when using comparable in a union #49602

@Code-Hex

Description

@Code-Hex

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

$ go version
go version devel go1.18-c2397905e0 Sat Nov 13 03:33:55 2021 +0000 darwin/arm64

Does this issue reproduce with the latest release?

No, because it includes generics

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

Whatever the go playground runs on

What did you do?

https://gotipplay.golang.org/p/FSMOjCXAtSL

What did you expect to see?

can compile

What did you see instead?

compile error

./prog.go:6:66: cannot use comparable in union (interface contains methods)

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions