summaryrefslogtreecommitdiff
path: root/compiler/GHC/Rename/Module.hs
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2020-05-25 16:11:10 -0400
committerBen Gamari <ben@smart-cactus.org>2020-06-13 15:58:37 -0400
commita31218f7737a65b6333ec7905e88dc094703f025 (patch)
treeac5c9a2a8161da0c44605ac4d7ffe5df1719461c /compiler/GHC/Rename/Module.hs
parent7a773f169cfe072c7b29924c53075e4dfa4e2adb (diff)
downloadhaskell-a31218f7737a65b6333ec7905e88dc094703f025.tar.gz
Use HsForAllTelescope to avoid inferred, visible foralls
Currently, `HsForAllTy` permits the combination of `ForallVis` and `Inferred`, but you can't actually typecheck code that uses it (e.g., `forall {a} ->`). This patch refactors `HsForAllTy` to use a new `HsForAllTelescope` data type that makes a type-level distinction between visible and invisible `forall`s such that visible `forall`s do not track `Specificity`. That part of the patch is actually quite small; the rest is simply changing consumers of `HsType` to accommodate this new type. Fixes #18235. Bumps the `haddock` submodule.
Diffstat (limited to 'compiler/GHC/Rename/Module.hs')
-rw-r--r--compiler/GHC/Rename/Module.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/GHC/Rename/Module.hs b/compiler/GHC/Rename/Module.hs
index 533a794807..e610a60ff3 100644
--- a/compiler/GHC/Rename/Module.hs
+++ b/compiler/GHC/Rename/Module.hs
@@ -2182,13 +2182,13 @@ rnConDecl (XConDecl (ConDeclGADTPrefixPs { con_gp_names = names, con_gp_ty = ty
-- Note [GADT abstract syntax] (Wrinkle: No nested foralls or contexts)
-- in GHC.Hs.Type.
; case res_ty of
- L l (HsForAllTy { hst_fvf = fvf })
- | ForallVis <- fvf
+ L l (HsForAllTy { hst_tele = tele })
+ | HsForAllVis{} <- tele
-> setSrcSpan l $ addErr $ withHsDocContext ctxt $ vcat
[ text "Illegal visible, dependent quantification" <+>
text "in the type of a term"
, text "(GHC does not yet support this)" ]
- | ForallInvis <- fvf
+ | HsForAllInvis{} <- tele
-> nested_foralls_contexts_err l ctxt
L l (HsQualTy {})
-> nested_foralls_contexts_err l ctxt