Print hooked sort elements correctly #914
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes the way that we print and serialize collection elements. Previously, we assumed that the elements of collections were uniformly of sort
KItem
. This is indeed the case for the built-inMap
,Set
andList
sorts, but the assumption breaks down in the presence of custom collection sorts that sort their elements differently (for example, defining a customMap
that requires its keys to only be integers). Terms of these custom sorts are printed incorrectly, with spurious injections intoKItem
rather than their actual element sorts.The solution to the problem is to look up the argument sorts of the element constructor when printing and serializing collections; the required information is already present in the binary and just requires a bit of refactoring to access.
This PR makes the following changes:
Map
's element constructor is stripped of sort injection #886 as a new integration test.emitDataTable
infrastructure and so required custom C functions to be written to index into them.Fixes #886