Commit de50f8fd authored by chessai's avatar chessai Committed by Krzysztof Gogolewski

don't suggest Rank2Types in error messages (Fixed #16000)

Summary: Rank2Types is deprecated. Don't suggest to users to use it.

Reviewers: bgamari, RyanGlScott, simonpj

Reviewed By: RyanGlScott, simonpj

Subscribers: RyanGlScott, rwbarton, carter

GHC Trac Issues: #16000

Differential Revision: https://phabricator.haskell.org/D5447
parent 68d6a716
......@@ -427,7 +427,7 @@ data Rank = ArbitraryRank -- Any rank ok
rankZeroMonoType, tyConArgMonoType, synArgMonoType, constraintMonoType :: Rank
rankZeroMonoType = MonoType (text "Perhaps you intended to use RankNTypes or Rank2Types")
rankZeroMonoType = MonoType (text "Perhaps you intended to use RankNTypes")
tyConArgMonoType = MonoType (text "GHC doesn't yet support impredicative polymorphism")
synArgMonoType = MonoType (text "Perhaps you intended to use LiberalTypeSynonyms")
constraintMonoType = MonoType (vcat [ text "A constraint must be a monotype"
......@@ -618,7 +618,7 @@ forAllTyErr env rank ty
herald | null tvs = text "Illegal qualified type:"
| otherwise = text "Illegal polymorphic type:"
suggestion = case rank of
LimitedRank {} -> text "Perhaps you intended to use RankNTypes or Rank2Types"
LimitedRank {} -> text "Perhaps you intended to use RankNTypes"
MonoType d -> d
_ -> Outputable.empty -- Polytype is always illegal
......
SimpleFail15.hs:5:8: error:
• Illegal qualified type: (a ~ b) => t
Perhaps you intended to use RankNTypes or Rank2Types
Perhaps you intended to use RankNTypes
• In the type signature: foo :: (a, b) -> (a ~ b => t) -> (a, b)
T12083a.hs:5:1: error:
• Illegal qualified type: Num a => a
Perhaps you intended to use RankNTypes or Rank2Types
Perhaps you intended to use RankNTypes
• In the type synonym declaration for ‘Constrd’
T12083a.hs:9:26: error:
......
T12083b.hs:6:5: error:
• Illegal qualified type: Eq a => r
Perhaps you intended to use RankNTypes or Rank2Types
Perhaps you intended to use RankNTypes
• When checking the class method:
test :: forall a r. Class a => a -> (Eq a => r) -> r
In the class declaration for ‘Class’
T2538.hs:6:6: error:
• Illegal qualified type: Eq a => a -> a
Perhaps you intended to use RankNTypes or Rank2Types
Perhaps you intended to use RankNTypes
• In the type signature:
f :: (Eq a => a -> a) -> Int
......
T5957.hs:3:9: error:
• Illegal qualified type: Show a => a -> String
Perhaps you intended to use RankNTypes or Rank2Types
Perhaps you intended to use RankNTypes
• In the type signature:
flex :: Int -> Show a => a -> String
tcfail184.hs:8:19: error:
• Illegal polymorphic type: forall a. Ord a => [a] -> [a]
Perhaps you intended to use RankNTypes or Rank2Types
Perhaps you intended to use RankNTypes
• In the definition of data constructor ‘MkSwizzle’
In the newtype declaration for ‘Swizzle’
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment