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

cmd/go2go: error message for mismatched arguments does not reference both arguments' types #39725

dpinela opened this issue Jun 20, 2020 · 2 comments


Copy link

@dpinela dpinela commented Jun 20, 2020

Does this issue reproduce with the latest release?

This occurs in the playground at the time of writing.

What did you do?

Try to run the following program:

What did you expect to see?

The error message explicitly points out that two different types were substituted for T in the call to Any (and what the types were), perhaps like this:
type func(f []byte) bool of (func(f []byte) bool literal) does not match func(string) bool

What did you see instead?

type func(f []byte) bool of (func(f []byte) bool literal) does not match func(T) bool

This message is unhelpful as, unlike in non-generic code, it doesn't tell us which type we should have used, and does not reveal the fundamental problem - the mismatch between string and []byte.

Copy link

@gopherbot gopherbot commented Jul 1, 2020

Change mentions this issue: [dev.go2go] go/types: report inferred type when a type argument doesn't match

Copy link

@griesemer griesemer commented Jul 1, 2020

Fixed on dev.go2go.

@griesemer griesemer closed this Jul 1, 2020
gopherbot pushed a commit that referenced this issue Jul 1, 2020
…'t match

Fixes #39725.

Change-Id: I48248283ae0eb635d489d8661512f32b98700c1a
Reviewed-by: Robert Griesemer <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.