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: report better errors when type sets are empty #51525

Open
griesemer opened this issue Mar 7, 2022 · 0 comments
Open

go/types, types2: report better errors when type sets are empty #51525

griesemer opened this issue Mar 7, 2022 · 0 comments
Assignees
Labels
NeedsFix
Milestone

Comments

@griesemer
Copy link
Contributor

@griesemer griesemer commented Mar 7, 2022

Error messages are confusing when type sets are empty. For instance, for:

func _[T interface{comparable; ~int; ~string}](x T) {
        _ = x == x // ERROR cannot compare x == x
}

the error doesn't say why the comparison is not possible. The root cause is that T's type set is empty.

The same applies to other operations, such as + in this case.

cc: @findleyr

@griesemer griesemer added the NeedsFix label Mar 7, 2022
@griesemer griesemer added this to the Go1.19 milestone Mar 7, 2022
@griesemer griesemer self-assigned this Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix
Projects
None yet
Development

No branches or pull requests

1 participant