-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Open
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.NeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.
Milestone
Description
My reading of the Go spec is that this is valid:
package p
type S1 struct { *S2 }
type S2 struct { *S1 }
func (*S1) M() {}
var _ = S1.M
Rationale:
- Because of
func (*S1) M() {}
,M
is a member of*S1
's method set. - Because of the
*S1
embedding intoS2
,M
is also a member ofS2
and*S2
's method sets. - Because of the
*S2
embedding intoS1
,M
should also be a member ofS1
's method set.
However, cmd/compile, gccgo, and gotype all reject it.
Metadata
Metadata
Assignees
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.NeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.