Skip to content

cmd/go2go: instantiating struct w/ generic embedded member fails #39671

@shanemhansen

Description

@shanemhansen

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

Go2go playground: https://go2goplay.golang.org/p/xwo0nvioxDT

Does this issue reproduce with the latest release?

Yes

What did you do?

Used the lock type mentioned in the generics draft.

https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md

https://go2goplay.golang.org/p/xwo0nvioxDT

It appears that when you use generic struct embedding AND attempt to instantiate the generic struct you get an error: "undefined: T"

What did you expect to see?

I expected the program to compile.

What did you see instead?

# play
./prog.go2:16: undefined: T

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