Skip to content

Commit 3cdc0a2

Browse files
alt-romesMikolaj
authored andcommitted
Prefer ErrorCall to ErrorCallWithLocation
This future proofs the code for CLC#285, which will remove `ErrorCallWithLocation` to de-duplicate duplicate CallStacks. ErrorCall is already a pattern synonym with the same meaning as it will have in the future, so this change is backwards compatible too. (cherry picked from commit db683f2)
1 parent 57cbb08 commit 3cdc0a2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Cabal-syntax/src/Distribution/Compat/Binary.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ decodeOrFailIO :: Binary a => ByteString -> IO (Either String a)
2020
decodeOrFailIO bs =
2121
catch (evaluate (decode bs) >>= return . Right) handler
2222
where
23-
handler (ErrorCallWithLocation str _) = return $ Left str
23+
handler (ErrorCall str) = return $ Left str

Cabal-syntax/src/Distribution/Utils/Structured.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ structuredDecodeOrFailIO :: (Binary.Binary a, Structured a) => LBS.ByteString ->
277277
structuredDecodeOrFailIO bs =
278278
catch (evaluate (structuredDecode bs) >>= return . Right) handler
279279
where
280-
handler (ErrorCallWithLocation str _) = return $ Left str
280+
handler (ErrorCall str) = return $ Left str
281281

282282
-- | Lazily reconstruct a value previously written to a file.
283283
structuredDecodeFileOrFail :: (Binary.Binary a, Structured a) => FilePath -> IO (Either String a)

0 commit comments

Comments
 (0)