Fix typechecking of partial type signaures (#16728)
This MR has two commits
-
Fix issue #16728 (closed). This is the main payload; commit message below
-
Fix a couuple of in-scope set problems that led to a crash with a DEBUG compiler. This small commit is unrelated to (1); I just tripped over it when doing the other fix.
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 (closed).
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.