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

Fix crashes in astdiff when sorting union items #7842

Merged
merged 1 commit into from Nov 1, 2019

Conversation

@JukkaL
Copy link
Collaborator

JukkaL commented Nov 1, 2019

Previously the snapshots could be unsortable, since the snapshot
tuples could have inconsistent types. This attemps to make the types
in tuples predictable based on the tuple prefix.

More formally, consider these two snapshot tuples:

   (x1, ..., xn, xn+1, ...)
   (y1, ..., yn, yn+1, ...)

If (x1, ..., xn) == (y1, ..., yn), xn+1 and yn+1 must be
comparable.

Attempt to fix #7834.

Previously the snapshots could be unsortable, since the snapshot
tuples could have inconsistent types. This attemps to make the types
in tuples predictable based on the tuple prefix.

More formally, consider these two snapshot tuples:

   (x1, ..., xn, xn+1, ...)
   (y1, ..., yn, yn+1, ...)

If (x1, ..., xn) == (y1, ..., yn), xn+1 and yn+1 must be
comparable.

Attempt to fix #7834.
@JukkaL JukkaL requested a review from ilevkivskyi Nov 1, 2019
Copy link
Collaborator

ilevkivskyi left a comment

Thanks! Just one question, otherwise LG.

@@ -282,9 +292,9 @@ def visit_deleted_type(self, typ: DeletedType) -> SnapshotItem:

def visit_instance(self, typ: Instance) -> SnapshotItem:
return ('Instance',
typ.type.fullname(),
encode_optional_str(typ.type.fullname()),

This comment has been minimized.

Copy link
@ilevkivskyi

ilevkivskyi Nov 1, 2019

Collaborator

Doesn't this mean there is a bug elsewhere? Maybe we shouldn't mask it (especially if there is no repro)?

This comment has been minimized.

Copy link
@JukkaL

JukkaL Nov 1, 2019

Author Collaborator

I think that this is not a great place to detect the bug, since the traceback won't tell much.

@JukkaL JukkaL merged commit 78f2df9 into master Nov 1, 2019
3 checks passed
3 checks passed
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@JukkaL JukkaL deleted the daemon-crash branch Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.