on master help sign in
Fix incomplete pattern match in function type diffs
4a6dd82Evan Czaplicki
compiler/src/Type/Error.hs+2−4
@@ -254,8 +254,6 @@ diff dict ctx tipe1 tipe2 =
254 (other, Alias _ _ _ alias2) -> diff dict ctx other alias2
254 (other, Alias _ _ _ alias2) -> diff dict ctx other alias2
255
255
256 (Lambda a b cs, Lambda x y zs) -> diffLambda dict ctx (a:b:cs) (x:y:zs)
256 (Lambda a b cs, Lambda x y zs) -> diffLambda dict ctx (a:b:cs) (x:y:zs)
257− (Lambda a b cs, result ) -> diffLambda dict ctx (a:b:cs) [result]
258− (result , Lambda x y zs) -> diffLambda dict ctx [result] (x:y:zs)
259
257
260 (FlexVar x, other) -> Similar (H.nameToDoc x) (toDoc dict ctx other)
258 (FlexVar x, other) -> Similar (H.nameToDoc x) (toDoc dict ctx other)
261 (other, FlexVar x) -> Similar (toDoc dict ctx other) (H.nameToDoc x)
259 (other, FlexVar x) -> Similar (toDoc dict ctx other) (H.nameToDoc x)
@@ -348,7 +346,7 @@ yellowApply dict ctx home name tipe =
348
346
349
347
350--
348--
351−-- INVARIANT: notNull types1 && notNull types2
349+-- INVARIANT: length types1 >= 2 && length types2 >= 2
352--
350--
353diffLambda :: Localizer -> RT.Context -> [Type] -> [Type] -> Diff H.Doc
351diffLambda :: Localizer -> RT.Context -> [Type] -> [Type] -> Diff H.Doc
354diffLambda dict ctx types1 types2 =
352diffLambda dict ctx types1 types2 =
@@ -389,7 +387,7 @@ diffLambda dict ctx types1 types2 =
389
387
390
388
391--
389--
392−-- INVARIANT: notNull shortRevArgs && notNull longRevArgs
390+-- INVARIANT: length shortRevArgs >= 2 && length longRevArgs >= 2
393--
391--
394diffArgMismatch :: Localizer -> RT.Context -> [Type] -> H.Doc -> [Type] -> H.Doc -> Diff H.Doc
392diffArgMismatch :: Localizer -> RT.Context -> [Type] -> H.Doc -> [Type] -> H.Doc -> Diff H.Doc
395diffArgMismatch dict ctx shortRevArgs shortResult longRevArgs longResult =
393diffArgMismatch dict ctx shortRevArgs shortResult longRevArgs longResult =