Skip to content

馃悰 Fix: Layout Unification

Alistair O'Brien requested to merge ajob410/layout-unification-bug-fix into dev

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 馃悰 was 2 fold:

  • in Context.equal_item the C_lexists_var and C_lexists_eq cases weren't handled (returning false 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 a default_layout and create two functions evaluate_type_with_lexist and evaluate_type_with_default_layout for using lexist and Type.default_layout as default_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

馃悰 fix: layout unification.

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).

Merge request reports