Browse Source

Fix bug in records inference

main
Gil Mizrahi 6 months ago
parent
commit
695db264ed
1 changed files with 3 additions and 4 deletions
  1. +3
    -4
      src/frontend/src/Language/Giml/Types/Infer.hs

+ 3
- 4
src/frontend/src/Language/Giml/Types/Infer.hs View File

@@ -881,12 +881,11 @@ solveConstraint (constraint, ann) =
matches = M.elems $ M.intersectionWith Equality rec1 rec2
onlyLeft = M.difference rec1 rec2
onlyRight = M.difference rec2 rec1
ext1' <- genTypeVar "ext"
ext2' <- genTypeVar "ext"
ext' <- genTypeVar "ext"
pure
( map (flip (,) ann)
$ Equality (TypeRecExt (M.toList onlyLeft) ext1') (TypeVar ext2)
: Equality (TypeRecExt (M.toList onlyRight) ext2') (TypeVar ext1)
$ Equality (TypeRecExt (M.toList onlyLeft) ext') (TypeVar ext2)
: Equality (TypeRecExt (M.toList onlyRight) ext') (TypeVar ext1)
: matches
, mempty
)


Loading…
Cancel
Save