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
Closed

Comments

@zllangct
Copy link

@zllangct zllangct commented Sep 11, 2021

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 fzipp commented Sep 11, 2021

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

Loading

@cuonglm cuonglm closed this Sep 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants