on master help sign in
Compute diffs better

Thanks to #1683 for pointing out some weird logic. The variables should only be compatible if the new type is a superset of the old type. The erroneous cases were: - (Comparable, CompAppend) which breaks on Char - (Appendable, CompAppend) which breaks on (List X) - (Number, CompAppend) which breaks on Int and Float!

commit32ff9501f8e6abc4df214b1112dee6d5008ce95f authorEvan Czaplicki <evancz@users.noreply.github.com> dateTue 6 Mar 2018, 17:41 (9 years ago) parent364440d
1 file changed+3−7
builder/src/Deps/Diff.hs+3−7
builder/src/Deps/Diff.hs+3−7
@@ -259,22 +259,18 @@ isEquivalentRenaming varPairs =
259259 False
260260
261261 Just verifiedRenamings ->
262− all compatableVars verifiedRenamings
262+ all compatibleVars verifiedRenamings
263263 &&
264264 allUnique (map snd verifiedRenamings)
265265
266266
267−compatableVars :: (N.Name, N.Name) -> Bool
268−compatableVars (old, new) =
267+compatibleVars :: (N.Name, N.Name) -> Bool
268+compatibleVars (old, new) =
269269 case (categorizeVar old, categorizeVar new) of
270270 (CompAppend, CompAppend) -> True
271271 (Comparable, Comparable) -> True
272272 (Appendable, Appendable) -> True
273273 (Number , Number ) -> True
274−
275− (Comparable, CompAppend) -> True
276− (Appendable, CompAppend) -> True
277− (Number , CompAppend) -> True
278274 (Number , Comparable) -> True
279275
280276 (_, Var) -> True