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: change in embedded type ordering on dev.typeparams branch #47352

Closed
mdempsky opened this issue Jul 22, 2021 · 4 comments
Closed

go/types: change in embedded type ordering on dev.typeparams branch #47352

mdempsky opened this issue Jul 22, 2021 · 4 comments
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@mdempsky
Copy link
Member

The test program at https://play.golang.org/p/O5DRq3UlQRa currently prints type x.J interface{x.I; error}

But on dev.typeparams, since fe4f134, it prints type x.J interface{error; x.I}.

This broke a Google-internal test. I'm okay with fixing the test, but @findleyr suggested that maybe we should restore the original sort order. Filing the issue to decide.

/cc @griesemer @dominikh

@mdempsky mdempsky added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Jul 22, 2021
@mdempsky mdempsky added this to the Go1.18 milestone Jul 22, 2021
@griesemer
Copy link
Contributor

If this is an isolated incident, I vote for fixing the test. The print output is still deterministic, it's just that now it's based on source order rather than sort order.

We could just sort when printing, but then the output doesn't match the API order.

We could keep the (original) sorted order, but that would require a bit more work when sorting (we need to sort positions as well). It doesn't seem worth the effort. The go/types API doesn't make any guarantees with respect to the ordering of embedded interfaces, I believe.

@heschi
Copy link
Contributor

heschi commented Aug 12, 2021

Any further comments on this? If not, I'll change the test.

@griesemer
Copy link
Contributor

Please change the test - this seems the easiest way forward.

@heschi
Copy link
Contributor

heschi commented Aug 12, 2021

OK. Close the bug if you like.

@golang golang locked and limited conversation to collaborators Aug 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

4 participants