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/compile: avoid multiple errors on the same line (reminder issue) #29107

Closed
griesemer opened this issue Dec 5, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@griesemer
Copy link
Contributor

commented Dec 5, 2018

This is a follow-up on #28450 which improved an error message but reports multiple errors on the same line for the added test case below ( https://go-review.googlesource.com/c/go/+/152417 ):

package p

func f(a, b, c, d ...int)       {} // ERROR "non-final parameter a" "non-final parameter b" "non-final parameter c"
func g(a ...int, b ...int)      {} // ERROR "non-final parameter a"
func h(...int, ...int, float32) {} // ERROR "non-final parameter"

type a func(...float32, ...interface{}) // ERROR "non-final parameter"
type b interface {
	f(...int, ...int)                // ERROR "non-final parameter"
	g(a ...int, b ...int, c float32) // ERROR "non-final parameter a" "non-final parameter b"
	valid(...int)
}

Investigate if there's something off in gc/subr.go (error handling).

@griesemer griesemer added this to the Go1.12 milestone Dec 5, 2018

@fraenkel

This comment has been minimized.

Copy link
Contributor

commented Dec 5, 2018

@griesemer The sameline check compares messages which won't work in this case given the parameter name is contained within.

@gopherbot

This comment has been minimized.

Copy link

commented Dec 5, 2018

Change https://golang.org/cl/152758 mentions this issue: cmd/compile: avoid multiple errors regarding misuse of ... in signatures

@griesemer

This comment has been minimized.

Copy link
Contributor Author

commented Dec 5, 2018

@fraenkel Thanks. Still, it turns out there's an easy way to make this specific case work better. See the CL.

@gopherbot gopherbot closed this in cd47e89 Dec 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.