on master help sign in
Fix accidental creation of rigid variables when type-checking mixed record types when a type alias is given

Fixes the issue raised by Alexander

commit1609e61cba4584dfcc4bc688ef0c12a47e479555 authorEvan Czaplicki <info@elm-lang.org> dateMon 12 Aug 2013, 14:27 (13 years ago) parent17628a0
1 file changed+3−3
compiler/Type/Unify.hs+3−3
compiler/Type/Unify.hs+3−3
@@ -168,7 +168,7 @@ actuallyUnify span variable1 variable2 = do
168168
169169 (Record1 fields1 ext1, Record1 fields2 ext2) ->
170170 do sequence . concat . Map.elems $ Map.intersectionWith (zipWith unify') fields1 fields2
171− let mkRecord fs ext = liftIO . structuredVar $ Record1 fs ext
171+ let mkRecord fs ext = fresh . Just $ Record1 fs ext
172172 case (Map.null fields1', Map.null fields2') of
173173 (True , True ) -> unify' ext1 ext2
174174 (True , False) -> do
@@ -178,8 +178,8 @@ actuallyUnify span variable1 variable2 = do
178178 record1' <- mkRecord fields1' ext1
179179 unify' record1' ext2
180180 (False, False) -> do
181− record1' <- mkRecord fields1' =<< liftIO (var Flexible)
182− record2' <- mkRecord fields2' =<< liftIO (var Flexible)
181+ record1' <- mkRecord fields1' =<< fresh Nothing
182+ record2' <- mkRecord fields2' =<< fresh Nothing
183183 unify' record1' ext2
184184 unify' ext1 record2'
185185 where