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, types2: embedded field type cannot be a (pointer to a) type parameter #48334

Closed
zllangct opened this issue Sep 11, 2021 · 1 comment

Comments

@zllangct
Copy link

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

$ go version
go version devel go1.18-23832ba2e2 Sat Sep 11 05:05:56 2021 +0000 darwin/amd64

What did you do?

package main

type A[T any] struct {
	T
}

func main(){
	_=A[int]{}
}

What did you expect to see?

ok

What did you see instead?

// go2go playground is ok, something wrong here
# command-line-arguments
./main1.go:4:2: embedded field type cannot be a (pointer to a) type parameter
@fzipp
Copy link
Contributor

fzipp commented Sep 11, 2021

This works as intended, see #43621. The go2go playground is outdated.

@cuonglm cuonglm closed this as completed Sep 11, 2021
@golang golang locked and limited conversation to collaborators Sep 11, 2022
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

4 participants