Skip to content
  • Simon Peyton Jones's avatar
    Fix typechecking of partial type signatures · 48fb3482
    Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
    Partial type sigs had grown hair.  tcHsParialSigType was
    doing lots of unnecessary work, and tcInstSig was cloning it
    unnecessarily -- and the result didn't even work: #16728.
    
    This patch cleans it all up, described by TcHsType
      Note [Checking parital type signatures]
    
    I basically just deleted code... but very carefully!
    
    Some refactoring along the way
    
    * Distinguish more explicintly between "anonymous" wildcards "_"
      and "named" wildcards "_a".  I changed the names of a number
      of functions to make this distinction much more apparent.
    
    The patch also revealed that the code in `TcExpr`
    that implements the special typing rule for `($)` was wrong.
    It called `getRuntimeRep` in a situation where where was no
    particular reason to suppose that the thing had kind `TYPE r`.
    
    This caused a crash in typecheck/should_run/T10846.
    
    The fix was easy, and actually simplifies the code in `TcExpr`
    quite a bit.  Hooray.
    48fb3482