Skip to content

Uses of Binary decode should have a proper error message

In #8144 (closed) I changed the interface file format.

That can happen without you noticing because it just uses the Binary instance.

To deserialize it, we also use Binary. When that fails, the error message is

Binary.get(Usage): 50

The error message should at least also mention:

Reading the interface file failed

This is not a specific problem with interface files (it is actually a minor problem there since ghc will refrain from reading .hi files created by an older version), but it is in development, and independent from that, all uses of Binary decode should be guarded as it is a very partial function.

Trac metadata
Trac field Value
Version 7.6.3
Type Bug
TypeOfFailure OtherFailure
Priority low
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC mail@nh2.me
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information