[commit: ghc] master: don't suggest Rank2Types in error messages (Fixed #16000) (de50f8f)
git at git.haskell.org
git at git.haskell.org
Wed Dec 19 19:57:52 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/de50f8fd432f88d26a08b07c7bf08c5bff25472e/ghc
>---------------------------------------------------------------
commit de50f8fd432f88d26a08b07c7bf08c5bff25472e
Author: chessai <chessai1996 at gmail.com>
Date: Wed Dec 19 19:16:49 2018 +0100
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
>---------------------------------------------------------------
de50f8fd432f88d26a08b07c7bf08c5bff25472e
compiler/typecheck/TcValidity.hs | 4 ++--
testsuite/tests/indexed-types/should_fail/SimpleFail15.stderr | 2 +-
testsuite/tests/typecheck/should_fail/T12083a.stderr | 2 +-
testsuite/tests/typecheck/should_fail/T12083b.stderr | 2 +-
testsuite/tests/typecheck/should_fail/T2538.stderr | 2 +-
testsuite/tests/typecheck/should_fail/T5957.stderr | 2 +-
testsuite/tests/typecheck/should_fail/tcfail184.stderr | 2 +-
7 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs
index ca5db45..867e202 100644
--- a/compiler/typecheck/TcValidity.hs
+++ b/compiler/typecheck/TcValidity.hs
@@ -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
diff --git a/testsuite/tests/indexed-types/should_fail/SimpleFail15.stderr b/testsuite/tests/indexed-types/should_fail/SimpleFail15.stderr
index 13a0dff..55d0358 100644
--- a/testsuite/tests/indexed-types/should_fail/SimpleFail15.stderr
+++ b/testsuite/tests/indexed-types/should_fail/SimpleFail15.stderr
@@ -1,5 +1,5 @@
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)
diff --git a/testsuite/tests/typecheck/should_fail/T12083a.stderr b/testsuite/tests/typecheck/should_fail/T12083a.stderr
index 910d4c3..fe126f9 100644
--- a/testsuite/tests/typecheck/should_fail/T12083a.stderr
+++ b/testsuite/tests/typecheck/should_fail/T12083a.stderr
@@ -1,7 +1,7 @@
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:
diff --git a/testsuite/tests/typecheck/should_fail/T12083b.stderr b/testsuite/tests/typecheck/should_fail/T12083b.stderr
index ae9d487..87649ec 100644
--- a/testsuite/tests/typecheck/should_fail/T12083b.stderr
+++ b/testsuite/tests/typecheck/should_fail/T12083b.stderr
@@ -1,7 +1,7 @@
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’
diff --git a/testsuite/tests/typecheck/should_fail/T2538.stderr b/testsuite/tests/typecheck/should_fail/T2538.stderr
index dc87c5d..18c82bd 100644
--- a/testsuite/tests/typecheck/should_fail/T2538.stderr
+++ b/testsuite/tests/typecheck/should_fail/T2538.stderr
@@ -1,7 +1,7 @@
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
diff --git a/testsuite/tests/typecheck/should_fail/T5957.stderr b/testsuite/tests/typecheck/should_fail/T5957.stderr
index 8239d56..66bc0c1 100644
--- a/testsuite/tests/typecheck/should_fail/T5957.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5957.stderr
@@ -1,6 +1,6 @@
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
diff --git a/testsuite/tests/typecheck/should_fail/tcfail184.stderr b/testsuite/tests/typecheck/should_fail/tcfail184.stderr
index 930ef27..fd6f1fd 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail184.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail184.stderr
@@ -1,6 +1,6 @@
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’
More information about the ghc-commits
mailing list