Skip to content

Fix crashes in astdiff when sorting union items #7842

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

Merged
merged 1 commit into from
Nov 1, 2019
Merged

Conversation

JukkaL
Copy link
Collaborator

@JukkaL 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 November 1, 2019 12:01
Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@JukkaL JukkaL deleted the daemon-crash branch November 1, 2019 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Daemon crash: comparing tuple and None
2 participants