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

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

Closed
gnojus opened this issue Dec 8, 2022 · 2 comments
Closed

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

gnojus opened this issue Dec 8, 2022 · 2 comments
Assignees
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@gnojus
Copy link

gnojus commented Dec 8, 2022

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.

@seankhliao seankhliao added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 8, 2022
@seankhliao
Copy link
Member

cc @griesemer @findleyr

@griesemer griesemer self-assigned this Dec 9, 2022
@griesemer griesemer added this to the Go1.21 milestone Dec 9, 2022
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/457055 mentions this issue: go/types, types2: report type mismatch error when conversion is impossible

@griesemer griesemer modified the milestones: Go1.21, Go1.20 Dec 12, 2022
@griesemer griesemer added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Dec 12, 2022
@golang golang locked and limited conversation to collaborators Dec 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants