diff options
author | sheaf <sam.derbyshire@gmail.com> | 2021-12-06 10:13:06 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-12-07 06:29:38 -0500 |
commit | 7eb5606441bf11ba2ebd5f8904918dc82a2a3126 (patch) | |
tree | 752415cb996eec08cb4314e3f151839ce466a7bb /compiler | |
parent | 5dbdf8781cdf35799e73e270632af6aac8d92e51 (diff) | |
download | haskell-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')
-rw-r--r-- | compiler/GHC/Parser.y | 2 |
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 } ---------------------- |