Skip to content

go/types, types2: embedded field type cannot be a (pointer to a) type parameter #48334

@zllangct

Description

@zllangct

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions