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
Milestone

Comments

@slimsag
Copy link

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 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.

@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 modified the milestones: Go1.6, Unplanned Jul 23, 2015
@gopherbot
Copy link

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

@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
Development

No branches or pull requests

4 participants