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

Open
griesemer opened this issue Jun 5, 2021 · 1 comment
Assignees
Labels
Milestone

Comments

@griesemer
Copy link
Contributor

@griesemer griesemer commented Jun 5, 2021

Type-checking

package p

type T struct{}

func (t T) m(int) {}

var f func(x T)

func _() {
	f = T.m
}

reports

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
@gopherbot
Copy link

@gopherbot gopherbot commented Jun 5, 2021

Change https://golang.org/cl/325369 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 https://golang.org/cl/324733.

Fixes #46583.

Change-Id: Ica1410e4de561e64e58b753e3da04b32156cbaf6
Reviewed-on: https://go-review.googlesource.com/c/go/+/325369
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants