Skip to content

cmd/go2go: embedded generic pointer field cannot be referred to by name #40059

@rogpeppe

Description

@rogpeppe

commit 34f7622

The following program fails, but it should be OK by my reading of the draft proposal. It works when the embedded field isn't a pointer.

package main

func main() {
	var s S(int)
	_ = s.E
}

type S(type T) struct {
	*E(T)
}

type E(type T) struct {}

It prints this error:

./prog.go2:5: s.E undefined (type instantiate୦୦S୦int has no field or method E)

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions