Skip to content

cmd/compile: error message for missing method on type with another type embedded talks about the embedded type instead #47833

@zigo101

Description

@zigo101

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

$ go version
go version go1.17 linux/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

package main

type T0 struct {
	x int
}

func (T0) M0() {}

type T2 struct {
	T0
}

type Q *T2

var q Q

func main() {
	q.M0()
}

What did you expect to see?

q.M0 undefined (type Q has no field or method M0)

What did you see instead?

q.T0.M0 undefined (type T0 has no field or method M0, but does have M0)

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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions