• niteria's avatar
    Check InScopeSet in substTy and provide substTyUnchecked · 9d33adb6
    niteria authored
    This adds sanity checks to `substTy` that implement:
    
    > when calling substTy subst ty it should be the case that the in-scope
    > set in the substitution is a superset of
    > * The free vars of the range of the substitution
    > * The free vars of ty minus the domain of the substitution
    
    and replaces violators with unchecked version. The violators were found
    by running the GHC test suite.
    
    This ensures that I can work on this incrementally and that what I fix won't
    be undone by some other change.
    
    It also includes a couple of fixes that I've already done.
    
    Test Plan: ./validate
    
    Reviewers: simonmar, goldfire, simonpj, austin, bgamari
    
    Reviewed By: simonpj, bgamari
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1792
    
    GHC Trac Issues: #11371
    9d33adb6
CoreUtils.hs 84.9 KB