Fix typechecking of partial type signatures
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.
Showing
- compiler/rename/RnTypes.hs 5 additions, 2 deletionscompiler/rename/RnTypes.hs
- compiler/typecheck/TcBinds.hs 1 addition, 1 deletioncompiler/typecheck/TcBinds.hs
- compiler/typecheck/TcCanonical.hs 2 additions, 0 deletionscompiler/typecheck/TcCanonical.hs
- compiler/typecheck/TcExpr.hs 12 additions, 19 deletionscompiler/typecheck/TcExpr.hs
- compiler/typecheck/TcHsType.hs 91 additions, 70 deletionscompiler/typecheck/TcHsType.hs
- compiler/typecheck/TcRnDriver.hs 2 additions, 2 deletionscompiler/typecheck/TcRnDriver.hs
- compiler/typecheck/TcRnMonad.hs 13 additions, 4 deletionscompiler/typecheck/TcRnMonad.hs
- compiler/typecheck/TcRnTypes.hs 1 addition, 1 deletioncompiler/typecheck/TcRnTypes.hs
- compiler/typecheck/TcSigs.hs 5 additions, 16 deletionscompiler/typecheck/TcSigs.hs
- compiler/typecheck/TcType.hs 8 additions, 5 deletionscompiler/typecheck/TcType.hs
- testsuite/tests/partial-sigs/should_compile/T16728.hs 9 additions, 0 deletionstestsuite/tests/partial-sigs/should_compile/T16728.hs
- testsuite/tests/partial-sigs/should_compile/T16728.stderr 9 additions, 0 deletionstestsuite/tests/partial-sigs/should_compile/T16728.stderr
- testsuite/tests/partial-sigs/should_compile/T16728a.hs 8 additions, 0 deletionstestsuite/tests/partial-sigs/should_compile/T16728a.hs
- testsuite/tests/partial-sigs/should_compile/T16728a.stderr 20 additions, 0 deletionstestsuite/tests/partial-sigs/should_compile/T16728a.stderr
- testsuite/tests/partial-sigs/should_compile/T16728b.hs 9 additions, 0 deletionstestsuite/tests/partial-sigs/should_compile/T16728b.hs
- testsuite/tests/partial-sigs/should_compile/T16728b.stderr 13 additions, 0 deletionstestsuite/tests/partial-sigs/should_compile/T16728b.stderr
- testsuite/tests/partial-sigs/should_compile/all.T 3 additions, 0 deletionstestsuite/tests/partial-sigs/should_compile/all.T
- testsuite/tests/partial-sigs/should_fail/T14040a.stderr 4 additions, 4 deletionstestsuite/tests/partial-sigs/should_fail/T14040a.stderr
Loading
Please register or sign in to comment