You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tmp/sandbox622717221/main.go:13: cannot use test literal (type test) as type foo in assignment:
test does not implement foo (missing foo, bar, baz methods)
Error indicating each of the missing methods. The existing error message makes it seem as though adding the bar method is sufficient to fix the error. The format doesn't necessarily matter, but the error message should indicate all of the missing methods.
What did you see instead?
tmp/sandbox622717221/main.go:13: cannot use test literal (type test) as type foo in assignment:
test does not implement foo (missing bar method)
Error indicating a single missing method (no indication of why bar happens to be the method highlighted).
The text was updated successfully, but these errors were encountered:
go build -gcflags="-e" should display all compiler errors but it still won't do it for this specific case. I think the behaviour there should be changed?
@yaxinlx Just FYI, go/types is not used by the compiler, so that's not the reason why there's only one missing method shown (but go/types has the same "problem").
This is not so much an error but perhaps a "would like to have".
odeke-em
changed the title
Interface errors only show single missing method
cmd/compile: interface error should show all missing methods instead of just one
Oct 1, 2016
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?But should apply to all.
What operating system and processor architecture are you using (
go env
)?But should apply to all.
What did you do?
https://play.golang.org/p/Op7-5uXv2G
What did you expect to see?
Error indicating each of the missing methods. The existing error message makes it seem as though adding the
bar
method is sufficient to fix the error. The format doesn't necessarily matter, but the error message should indicate all of the missing methods.What did you see instead?
Error indicating a single missing method (no indication of why
bar
happens to be the method highlighted).The text was updated successfully, but these errors were encountered: