馃悰 Fix: Layout Unification
Motivation and Context
Related Issue(s): #1527 (closed)
Since !2103 (merged) a bug in layout unification (introduced in !2070 (merged)) where layouts weren't correctly propagated in some cases.
Description
The
-
in
Context.equal_item
theC_lexists_var
andC_lexists_eq
cases weren't handled (returningfalse
on equal items). -
in
Checking.evaluate_type
we weren't handling the default layout correctly in type declarations.The fix is to parameterize
evaluate_type
with adefault_layout
and create two functionsevaluate_type_with_lexist
andevaluate_type_with_default_layout
for usinglexist
andType.default_layout
asdefault_layout
, respectively.
This doesn't fix the decl_pos
issue in unification (as noted in #1527 (closed)). This will be fixed in a later MR.
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to not work as expected) -
Performance improvement (non-breaking change that improves performance) -
None (change with no changelog)
Changelog
Checklist:
-
Changes follow the existing coding style (use dune @fmt
to check). -
Tests for the changes have been added (for bug fixes / feature). -
Documentation has been updated. -
Changelog description has been added (if appropriate). -
Start titles under ## Changelog
section with #### (if appropriate). -
There is no image or uploaded file in changelog -
Examples in changed behaviour have been added to the changelog (for breaking change / feature).