Skip to content

Better error message for missing Rank2Types (or RankNTypes) flag

For a rank-2 type signature when the Rank2Types language option isn't enabled, GHC gives:

    Illegal polymorphic or qualified type: (Data a) => a -> RnM a
    In the type signature for `rnVarsIn':
      rnVarsIn :: ((Data a) => a -> RnM a)
                  -> [Vdef] -> Exp -> S.Set Var -> RnM ([Vdef], Exp)

It would be good to suggest using -XRank2Types or -XRankNTypes. (Sorry if this is already fixed; I don't have a working HEAD to test it with.)

Trac metadata
Trac field Value
Version 6.8.2
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information