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

types2: method expressions in error messages may have mixed named/unnamed parameters #46583

griesemer opened this issue Jun 5, 2021 · 1 comment


Copy link

@griesemer griesemer commented Jun 5, 2021


package p

type T struct{}

func (t T) m(int) {}

var f func(x T)

func _() {
	f = T.m


cannot use T.m (value of type func(t T, int)) as func(x T) value in assignment

where the 1st function type uses a named and an unnamed parameter.

This has already been addressed in go/types with CL 324733.

@griesemer griesemer added this to the Go1.18 milestone Jun 5, 2021
@griesemer griesemer self-assigned this Jun 5, 2021
Copy link

@gopherbot gopherbot commented Jun 5, 2021

Change mentions this issue: [dev.typeparams] cmd/compile/internal/types2: provide valid signature in errors involving method expressions

gopherbot pushed a commit that referenced this issue Jun 8, 2021
… in errors involving method expressions

This is an adjusted port of a similar fix in

Fixes #46583.

Change-Id: Ica1410e4de561e64e58b753e3da04b32156cbaf6
Trust: Robert Griesemer <>
Reviewed-by: Robert Findley <>
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
2 participants