Fix joins for row likes with incompatible kinds #139
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.
Row_likes used to be only contain fields of kind value. This changed with ocaml-flambda/ocaml#396
Now a join can be performed between a float record and a block that contains fields of incompatible type (with some help from GADTs). This is ok most of the time since they come with different tags, but it is possible to build a row like of unknown tag with unannotated fields accesses. Those can only occur on standard blocks. Float records accesses always comes with annotated accesses.
So we can consider a new invariant for row likes:
If they contains fields of kinds other than value, the tag must be known. And no tag can be used for both value and non value contents.
If this ever end up being too restrictive (with changes to the language allowing new kinds of blocks), we could change row like tags to carry fields kinds