Skip to content

WIP: Error Messages: Improve response for illegal forall and GADT Syntax

Jade requested to merge wip/T24448 into master

This patch aims to improve the error messages emitted with illegal forall and GADT syntax. Previously, using forall in a type with -XNoExplicitForAll

Perhaps you intended to use RankNTypes
or a similar language extension to enable explicit-forall syntax: forall <tvs>. <type>

This is confusing because the actual extension to enable the syntax is ExplicitForAll. The new error is:

Use ExplicitForAll
to enable syntax: forall <tvs>. <type>

Similarly -XNoGADTSyntax and data Foo where used to say:

Perhaps you intended to use GADTs
or a similar language extension to enable syntax: data T where

this patch changes it to

Use GADTSyntax
to enable syntax: data T where

Fixes: #24448

Merge request reports