addCoverageTicksTobind should not panic when file location is Nothing
compiler/deSugar/Coverage.lhs:
addCoverageTicksToBinds dflags mod mod_loc tyCons binds = do
let orig_file =
case ml_hs_file mod_loc of
Just file -> file
Nothing -> panic "can not find the original file during hpc trans"
Is there any reason for this function to panic? It is the only function (at least in my use-case) of the GHC API that panics on ms_hs_file = Nothing. I suggest to handle this more graceful and return emptyHpcInfo and emptyModBreaks just as in the case of file ending in .boot
Trac metadata
Trac field | Value |
---|---|
Version | 6.12.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |