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, cmd/compile: error message of 1.18 is less helpful with T.m instead of (*T).m #53358

Open
nojus297 opened this issue Jun 13, 2022 · 2 comments
Assignees
Labels
NeedsInvestigation
Milestone

Comments

@nojus297
Copy link

@nojus297 nojus297 commented Jun 13, 2022

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

$ go version
go version go1.18.3 linux/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

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

package main

type T int

func (*T) foo() {}

func main() {
	_ = T.foo
}

go 1.17:

./prog.go:8:7: invalid method expression T.foo (needs pointer receiver: (*T).foo)

go 1.18/tip:

./prog.go:8:8: cannot call pointer method foo on T

May be duplicate of #50954

@ianlancetaylor ianlancetaylor changed the title go/types, types2: error message of 1.18 is less helpful with T.m instead of (*T).m go/types, cmd/compile: error message of 1.18 is less helpful with T.m instead of (*T).m Jun 13, 2022
@ianlancetaylor ianlancetaylor added the NeedsInvestigation label Jun 13, 2022
@ianlancetaylor ianlancetaylor added this to the Backlog milestone Jun 13, 2022
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jun 13, 2022

CC @griesemer @findleyr

@griesemer griesemer self-assigned this Jun 13, 2022
@griesemer griesemer removed this from the Backlog milestone Jun 13, 2022
@griesemer griesemer added this to the Go1.20 milestone Jun 13, 2022
@griesemer griesemer removed this from the Go1.20 milestone Jun 13, 2022
@griesemer griesemer added this to the Go1.19 milestone Jun 13, 2022
@griesemer
Copy link
Contributor

@griesemer griesemer commented Jun 13, 2022

Tentatively marking for 1.19. Fine to move to 1.20 if we don't get to it.

@griesemer griesemer removed this from the Go1.19 milestone Jun 24, 2022
@griesemer griesemer added this to the Go1.20 milestone Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation
Projects
Status: No status
Development

No branches or pull requests

3 participants