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: no need to complain about missing type arguments after type inference error #50588

Closed
griesemer opened this issue Jan 12, 2022 · 2 comments
Assignees
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@griesemer
Copy link
Contributor

griesemer commented Jan 12, 2022

package p

type S[A, B any] struct {}

func _[A any](s S /* ERROR cannot infer B */ /* ERROR got 1 arguments but 2 type parameters */ [A]) {}

produces two error messages:

filename.go:5:17: cannot infer B (filename:go:3:11)
filename.go:5:17: got 1 arguments but 2 type parameters

There's no need to report the 2nd error.

Follow-up on #49541.

@griesemer griesemer added the NeedsFix The path to resolution is known, but the work has not been done. label Jan 12, 2022
@griesemer griesemer added this to the Go1.19 milestone Jan 12, 2022
@findleyr
Copy link
Contributor

findleyr commented Mar 7, 2022

Note that with type-type inference disabled this issue becomes obsolete. Leaving it open for 1.19, depending on what we do.

@griesemer
Copy link
Contributor Author

Type type-inference has been removed and this now reports one error as expected. Closing.

@golang golang locked and limited conversation to collaborators Jun 23, 2023
vangirja referenced this issue Jul 17, 2023
Fixes #9281

Change-Id: Id060e9cbad086c994ec74b240f5c61e971e5690b
Reviewed-on: https://go-review.googlesource.com/1490
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
Development

No branches or pull requests

3 participants