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

cmd/go2go: embedded generic pointer field cannot be referred to by name #40059

Closed
rogpeppe opened this issue Jul 5, 2020 · 1 comment
Closed

cmd/go2go: embedded generic pointer field cannot be referred to by name #40059

rogpeppe opened this issue Jul 5, 2020 · 1 comment
Assignees
Milestone

Comments

@rogpeppe
Copy link
Contributor

@rogpeppe rogpeppe commented Jul 5, 2020

commit 34f7622

The following program fails, but it should be OK by my reading of the draft proposal. It works when the embedded field isn't a pointer.

package main

func main() {
	var s S(int)
	_ = s.E
}

type S(type T) struct {
	*E(T)
}

type E(type T) struct {}

It prints this error:

./prog.go2:5: s.E undefined (type instantiate୦୦S୦int has no field or method E)
@ianlancetaylor ianlancetaylor self-assigned this Jul 5, 2020
@ianlancetaylor ianlancetaylor added this to the Unreleased milestone Jul 5, 2020
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jul 6, 2020

Thanks. This is now fixed on the dev.go2go branch (fix was https://golang.org/cl/241125, which I thought would fix a different case, but turned out to fix this as well).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.