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 type lists type checking seems incorrect #40961

Closed
tdakkota opened this issue Aug 21, 2020 · 1 comment
Closed

cmd/go2go: embedded type lists type checking seems incorrect #40961

tdakkota opened this issue Aug 21, 2020 · 1 comment

Comments

@tdakkota
Copy link

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

$ go version
go version devel +12c2128b9e Fri Aug 21 00:12:31 2020 +0000 windows/amd64

Does this issue reproduce with the latest release?

n/a

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

  • windows/amd64
  • go2go playground

What did you do?

https://go2goplay.golang.org/p/HClUuUkAS-m

What did you expect to see?

Successful compilation.
MyInt satisfies both type lists.

What did you see instead?

type checking failed for main
prog.go2:27:5: MyInt does not satisfy Sum (MyInt or int not found in ⊥)
@ianlancetaylor
Copy link
Contributor

I believe this is working as intended. Embedding two interfaces with type lists gives you the intersection of the type lists, which in this example is the empty set. See https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md#type-lists-in-embedded-constraints .

@golang golang locked and limited conversation to collaborators Aug 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants