Skip to content

go/types: type mismatch error less helpful since go 1.18 #57160

Closed
@gnojus

Description

@gnojus

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

$ go version
go version go1.19.4 linux/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

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

package main

func main() {
	_ = 0 < new(int)
}

go 1.17:

./main.go:4:8: invalid operation: 0 < new(int) (mismatched types int and *int)

go 1.18/19/tip:

./main.go:4:6: cannot convert 0 (untyped int constant) to *int

Also, even if the constant could be converted to *int, the < operator is not defined on it.

Metadata

Metadata

Assignees

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