summaryrefslogtreecommitdiff
path: root/compiler/GHC/Parser.y
diff options
context:
space:
mode:
authorsheaf <sam.derbyshire@gmail.com>2021-12-06 10:13:06 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-12-07 06:29:38 -0500
commit7eb5606441bf11ba2ebd5f8904918dc82a2a3126 (patch)
tree752415cb996eec08cb4314e3f151839ce466a7bb /compiler/GHC/Parser.y
parent5dbdf8781cdf35799e73e270632af6aac8d92e51 (diff)
downloadhaskell-7eb5606441bf11ba2ebd5f8904918dc82a2a3126.tar.gz
More permissive parsing of higher-rank type IPs
The parser now accepts implicit parameters with higher-rank types, such as `foo :: (?ip :: forall a. a -> a) => ...` Before this patch, we instead insisted on parentheses like so: `foo :: (?ip :: (forall a. a -> a)) => ...` The rest of the logic surrounding implicit parameters is unchanged; in particular, even with ImpredicativeTypes, this idiom is not likely to be very useful. Fixes #20654
Diffstat (limited to 'compiler/GHC/Parser.y')
-rw-r--r--compiler/GHC/Parser.y2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/Parser.y b/compiler/GHC/Parser.y
index d499341c36..d768ef2d04 100644
--- a/compiler/GHC/Parser.y
+++ b/compiler/GHC/Parser.y
@@ -2114,7 +2114,7 @@ ctype :: { LHsType GhcPs }
, hst_xqual = NoExtField
, hst_body = $3 })) }
- | ipvar '::' type {% acsA (\cs -> sLL $1 (reLoc $>) (HsIParamTy (EpAnn (glR $1) [mu AnnDcolon $2] cs) (reLocA $1) $3)) }
+ | ipvar '::' ctype {% acsA (\cs -> sLL $1 (reLoc $>) (HsIParamTy (EpAnn (glR $1) [mu AnnDcolon $2] cs) (reLocA $1) $3)) }
| type { $1 }
----------------------