Skip to content
  • Facundo Domínguez's avatar
    Have addModFinalizer expose the local type environment. · 8d634194
    Facundo Domínguez authored and Ben Gamari's avatar Ben Gamari committed
    Summary:
    This annotates the splice point with 'HsSpliced ref e' where 'e' is the
    result of the splice. 'ref' is a reference that the typechecker will fill with
    the local type environment.
    
    The finalizer then reads the ref and uses the local type environment, which
    causes 'reify' to find local variables when run in the finalizer.
    
    Test Plan: ./validate
    
    Reviewers: simonpj, simonmar, bgamari, austin, goldfire
    
    Reviewed By: goldfire
    
    Subscribers: simonmar, thomie, mboes
    
    Differential Revision: https://phabricator.haskell.org/D2286
    
    GHC Trac Issues: #11832
    
    (cherry picked from commit 567dbd9b)
    8d634194