Skip to content

cmd/compile: poor error message when invoking method on embedded type #15711

@dsymonds

Description

@dsymonds

Please answer these questions before submitting your issue. Thanks!

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

go1.6.2

  1. What operating system and processor architecture are you using (go env)?

The playground

  1. What did you do?

https://play.golang.org/p/hsjwmQwtsb

Relevant snippet:

func TestFoo(t *testing.T) {
    t.Fail("what?")
}
  1. What did you expect to see?
prog.go:14: too many arguments in call to t.Fail
  1. What did you see instead?
prog.go:14: too many arguments in call to t.common.Fail

The .common bit is unexpected and an implementation detail. Running godoc testing Fail shows a simple method func (c *T) Fail(), and the fact that testing.T embeds testing.common does not seem useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions