Skip to content
  • Sebastian Graf's avatar
    Add RubbishLit for absent bindings of UnliftedRep · 448b77b9
    Sebastian Graf authored and Krzysztof Gogolewski's avatar Krzysztof Gogolewski committed
    Summary:
    Trac #9279 reminded us that the worker wrapper transformation copes
    really badly with absent unlifted boxed bindings.
    
    As `Note [Absent errors]` in WwLib.hs points out, we can't just use
    `absentError` for unlifted bindings because there is no bottom to hide
    the error in.
    So instead, we synthesise a new `RubbishLit` of type
    `forall (a :: TYPE 'UnliftedRep). a`, which code-gen may subsitute for
    any boxed value. We choose `()`, so that there is a good chance that
    the program crashes instead instead of leading to corrupt data, should
    absence analysis have been too optimistic (#11126).
    
    Reviewers: simonpj, hvr, goldfire, bgamari, simonmar
    
    Reviewed By: simonpj
    
    Subscribers: osa1, rwbarton, carter
    
    GHC Trac Issues: #15627, #9279, #4306, #11126
    
    Differential Revision: https://phabricator.haskell.org/D5153
    448b77b9