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

go/types, types2: better error message for unsatisfied type constraint #57500

Closed
griesemer opened this issue Dec 29, 2022 · 5 comments
Closed
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@griesemer
Copy link
Contributor

The test case in src/internal/types/testdata/fixedbugs/issue57486.go reports the error

[2]any does not implement C2 ([2]any missing in int)

even though the [2]any is in the constraint (but not in the type set). Should provide a better error message.

@griesemer griesemer added the NeedsFix The path to resolution is known, but the work has not been done. label Dec 29, 2022
@griesemer griesemer added this to the Go1.21 milestone Dec 29, 2022
@griesemer griesemer self-assigned this Dec 29, 2022
@gopherbot
Copy link

Change https://go.dev/cl/460455 mentions this issue: cmd/compile: better error message for when a type is in a constraint but not the type set

@griesemer
Copy link
Contributor Author

cc: https://github.com/orgs/golang/teams/release to decide if the CL above is acceptable to submit for 1.20. The change only affects some error messages that are currently somewhat confusing. There's no impact on correct code.

@griesemer griesemer modified the milestones: Go1.21, Go1.20 Jan 4, 2023
@findleyr
Copy link
Contributor

findleyr commented Jan 4, 2023

CC @golang/release (not sure if the other link pings them)

@aclements aclements added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jan 10, 2023
@griesemer
Copy link
Contributor Author

Marking as release blocker simply for visibility: we certainly don't need this fix, but it produces a much better error message in some cases where currently the error message is very confusing. The change doesn't affect correct code at all, it's only run in case of a specific error.

Leaving for release team to decide. If ok, feel free to submit, the CL is up-to-date. Otherwise, move to 1.21. Thanks.

@heschi
Copy link
Contributor

heschi commented Jan 11, 2023

Given that it only affects error cases, this seems completely fine. Submitted.

@golang golang locked and limited conversation to collaborators Jan 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

5 participants