Skip to content

Make the parsing of ImplicitParameter kinds slightly more permissive

sheaf requested to merge sheaf/ghc:T20654 into master

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 due to #18759. However, it seems better to reject these during typechecking, instead of causing a parse error.

Merge request reports