Skip to content

cmd/compile: no need to complain about missing type arguments after type inference error #50588

@griesemer

Description

@griesemer
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.

Metadata

Metadata

Labels

FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions