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 types ignored in interface implementation #40199

Open
JavierZunzunegui opened this issue Jul 14, 2020 · 7 comments
Open

cmd/go2go: embedded types ignored in interface implementation #40199

JavierZunzunegui opened this issue Jul 14, 2020 · 7 comments
Assignees
Milestone

Comments

@JavierZunzunegui
Copy link

@JavierZunzunegui JavierZunzunegui commented Jul 14, 2020

This is not a generics proposal, but reporting a bug in the generics branch. First presented in golang-nuts.

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

generics branch (from https://go2goplay.golang.org/)

Does this issue reproduce with the latest release?

No, just generics branch

What operating system and processor architecture are you using (go env)?

N/A (in https://go2goplay.golang.org/)

What did you do?

Assigned a generic type to an interface satisfied by a struct embedded in it.
https://go2goplay.golang.org/p/fOJIhgnbOxC

What did you expect to see?

It would implement the interface, and compile.

What did you see instead?

It doesn't implement the interface, and therefore doesn't compile.

@andybons
Copy link
Member

@andybons andybons commented Jul 14, 2020

@andybons andybons added this to the Unplanned milestone Jul 14, 2020
@mmaedel
Copy link

@mmaedel mmaedel commented Jul 14, 2020

Hi can you please change title?

cmd/go2go...

@griesemer griesemer changed the title generics: embedded types ignored in interface implementation cmd/go2go: embedded types ignored in interface implementation Jul 14, 2020
@griesemer
Copy link
Contributor

@griesemer griesemer commented Jul 14, 2020

@mmaedel Done.

@griesemer
Copy link
Contributor

@griesemer griesemer commented Jul 14, 2020

This code passes the type-checker. Likely an issue with the translator phase.

@griesemer
Copy link
Contributor

@griesemer griesemer commented Aug 28, 2020

Test case updated to new syntax: https://go2goplay.golang.org/p/Ssd4Ws7F91G

@JavierZunzunegui
Copy link
Author

@JavierZunzunegui JavierZunzunegui commented Sep 8, 2020

Just checking in - is this bug being looked into?
And particularly, has there been any discussion within the go team about Type embedding in generic types?

@griesemer
Copy link
Contributor

@griesemer griesemer commented Sep 8, 2020

See https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md#embedded-type-parameter-methods.

We know about this bug, but it's not urgent. Note that dev.go2go is a prototype. Not everything will be supported.

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
5 participants
You can’t perform that action at this time.