Skip to content

go/types, types2: better error message for cases of reverse type inference #60747

@griesemer

Description

@griesemer

This is a reminder issue to follow up on feedback in https://go.dev/cl/501938 (#60688).

v9 func(string) []int = f5 // ERROR "type func(string) []int of variable in assignment does not match inferred type func(string) []string for func(P) []P"

Feedback (@findleyr):

I think a better error would be "type func(string) []int of variable v9 does not match inferred type func(string) []string for f5"

Metadata

Metadata

Assignees

Labels

BadErrorMessageIssues related compiler error messages that should be better.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.TypeInferenceIssue is related to generic type inference

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions