summaryrefslogtreecommitdiff
path: root/compiler/profiling-notes
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2020-11-13 10:56:20 -0500
committerRyan Scott <ryan.gl.scott@gmail.com>2020-11-13 13:40:02 -0500
commite5dabf5534b55a340df10ed486fdb6afb054457d (patch)
tree9307f057bbbf0fa4c91b6b651e734dbb27dabc10 /compiler/profiling-notes
parent2987366d0b061b35b85e72228115a616b6616dd9 (diff)
downloadhaskell-wip/T18939.tar.gz
Use tcSplitForAllInvisTyVars (not tcSplitForAllTyVars) in more placeswip/T18939
The use of `tcSplitForAllTyVars` in `tcDataFamInstHeader` was the immediate cause of #18939, and replacing it with a new `tcSplitForAllInvisTyVars` function (which behaves like `tcSplitForAllTyVars` but only splits invisible type variables) fixes the issue. However, this led me to realize that _most_ uses of `tcSplitForAllTyVars` in GHC really ought to be `tcSplitForAllInvisTyVars` instead. While I was in town, I opted to replace most uses of `tcSplitForAllTys` with `tcSplitForAllTysInvis` to reduce the likelihood of such bugs in the future. I say "most uses" above since there is one notable place where we _do_ want to use `tcSplitForAllTyVars`: in `GHC.Tc.Validity.forAllTyErr`, which produces the "`Illegal polymorphic type`" error message if you try to use a higher-rank `forall` without having `RankNTypes` enabled. Here, we really do want to split all `forall`s, not just invisible ones, or we run the risk of giving an inaccurate error message in the newly added `T18939_Fail` test case. I debated at some length whether I wanted to name the new function `tcSplitForAllInvisTyVars` or `tcSplitForAllTyVarsInvisible`, but in the end, I decided that I liked the former better. For consistency's sake, I opted to rename the existing `splitPiTysInvisible` and `splitPiTysInvisibleN` functions to `splitInvisPiTys` and `splitPiTysInvisN`, respectively, so that they use the same naming convention. As a consequence, this ended up requiring a `haddock` submodule bump. Fixes #18939.
Diffstat (limited to 'compiler/profiling-notes')
0 files changed, 0 insertions, 0 deletions