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: should accept method recv base type that is alias to a pointer type #28251

Closed
griesemer opened this issue Oct 17, 2018 · 1 comment
Closed

Comments

@griesemer
Copy link
Contributor

@griesemer griesemer commented Oct 17, 2018

Per #27995, this code should be accepted:

package p

type T struct{}

type T1 = *T

func (T1) m() {}

func _() {
	(&T{}).m()
}

Right now we get:

$ gotype y.go
y.go:10:9: invalid operation: (&(T literal)) (value of type *T) has no field or method m

cmd/compile accepts it.

@griesemer griesemer added this to the Go1.12 milestone Oct 17, 2018
@griesemer griesemer self-assigned this Oct 17, 2018
@gopherbot
Copy link

@gopherbot gopherbot commented Oct 18, 2018

Change https://golang.org/cl/143179 mentions this issue: go/types: accept recv base type that is alias to a pointer type

Loading

@gopherbot gopherbot closed this in f563652 Oct 19, 2018
@golang golang locked and limited conversation to collaborators Oct 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants