Skip to content
  • Ryan Scott's avatar
    Don't drop GHCi-defined functions with -fobject-code enabled · ddb870bf
    Ryan Scott authored
    The desugarer was using `targetRetainsAllBindings` as a litmus test for
    determining if a function was defined in interactive mode (and thus
    should be exported). However, there is a corner case where one can be in
    interactive mode and have `targetRetainsAllBindings` return `False`: if
    `-fobject-code` is enabled (since the target will no longer be
    `HscInteractive`). In such a scenario, we should fall back on a
    different test for determining if we are in a GHCi session. I chose to
    use `isInteractiveModule`, which appears to do the trick.
    
    Test Plan: make test TEST=T12091
    
    Reviewers: austin, bgamari
    
    Subscribers: rwbarton, thomie
    
    GHC Trac Issues: #12091
    
    Differential Revision: https://phabricator.haskell.org/D3849
    ddb870bf