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

Closed
gnojus opened this issue Jun 13, 2022 · 3 comments
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@gnojus
Copy link

gnojus 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 Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 13, 2022
@ianlancetaylor ianlancetaylor added this to the Backlog milestone Jun 13, 2022
@ianlancetaylor
Copy link
Contributor

CC @griesemer @findleyr

@griesemer griesemer self-assigned this Jun 13, 2022
@griesemer griesemer modified the milestones: Backlog, Go1.20, Go1.19 Jun 13, 2022
@griesemer
Copy link
Contributor

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

@griesemer griesemer modified the milestones: Go1.19, Go1.20 Jun 24, 2022
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
@griesemer griesemer modified the milestones: Go1.20, Go1.21 Nov 21, 2022
@gopherbot
Copy link

Change https://go.dev/cl/455335 mentions this issue: go/types, types2: better error message for invalid method expression

@golang golang locked and limited conversation to collaborators Dec 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Development

No branches or pull requests

4 participants