Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go/types: interface implementation error should give a missing method #10260

Closed
slimsag opened this issue Mar 26, 2015 · 2 comments
Closed

go/types: interface implementation error should give a missing method #10260

slimsag opened this issue Mar 26, 2015 · 2 comments
Assignees
Milestone

Comments

@slimsag
Copy link

@slimsag slimsag commented Mar 26, 2015

Consider this very simple play.golang.org program.

Running this program using the current Go compiler produces some very helpful output:

/tmp/sandbox112601999/main.go:11: cannot use S literal (type *S) as type X in assignment:
    *S does not implement X (missing foo method)

However the same program checked via golang.org/x/tools/go/types.Check produces a much less helpful error:

test.go:12:17: cannot assign &(S literal) (value of type *S) to x (variable of type X)

Note the lacking specifics of *S does not implement X (missing foo method) in the above error.

@rsc
Copy link
Contributor

@rsc rsc commented Apr 10, 2015

This isn't API so it can be done after 1.5. Feel free to change the milestone if you want to fix for 1.5 anyway.

Loading

@rsc rsc changed the title x/tools/go/types: Interface implementation errors are not descriptive. go/types: interface implementation error should give a missing method Apr 10, 2015
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@griesemer griesemer added this to the Go1.6 milestone Jul 23, 2015
@griesemer griesemer removed this from the Unplanned milestone Jul 23, 2015
@gopherbot
Copy link

@gopherbot gopherbot commented Sep 16, 2015

CL https://golang.org/cl/14644 mentions this issue.

Loading

@griesemer griesemer closed this in 3a80e5b Sep 18, 2015
@golang golang locked and limited conversation to collaborators Sep 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants