summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2022-10-25 17:05:46 +0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-10-26 00:02:01 -0400
commit0270cc54481bef9630274e77c2750940c1a4eff5 (patch)
tree36375e6f74da495ca308f1d060cd30aad4f4fb24
parentf7bfb40c9010ff34d301c9cf8c805261699daad5 (diff)
downloadhaskell-0270cc54481bef9630274e77c2750940c1a4eff5.tar.gz
Introduce TcRnWithHsDocContext (#22346)
Before this patch, GHC used withHsDocContext to attach an HsDocContext to an error message: addErr $ mkTcRnUnknownMessage $ mkPlainError noHints (withHsDocContext ctxt msg) The problem with this approach is that it only works with TcRnUnknownMessage. But could we attach an HsDocContext to a structured error message in a generic way? This patch solves the problem by introducing a new constructor to TcRnMessage: data TcRnMessage where ... TcRnWithHsDocContext :: !HsDocContext -> !TcRnMessage -> TcRnMessage ...
-rw-r--r--compiler/GHC/Rename/HsType.hs20
-rw-r--r--compiler/GHC/Rename/Module.hs6
-rw-r--r--compiler/GHC/Rename/Utils.hs9
-rw-r--r--compiler/GHC/Tc/Errors/Ppr.hs27
-rw-r--r--compiler/GHC/Tc/Errors/Types.hs8
-rw-r--r--compiler/GHC/Tc/Gen/HsType.hs2
-rw-r--r--compiler/GHC/Types/Error/Codes.hs1
-rw-r--r--testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInPatternSignature.stderr4
-rw-r--r--testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInTypeSpliceUsed.stderr2
-rw-r--r--testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardNotLast.stderr8
-rw-r--r--testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardTwice.stderr8
-rw-r--r--testsuite/tests/partial-sigs/should_fail/NestedExtraConstraintsWildcard.stderr8
-rw-r--r--testsuite/tests/partial-sigs/should_fail/NestedNamedExtraConstraintsWildcard.stderr8
-rw-r--r--testsuite/tests/partial-sigs/should_fail/PartialClassMethodSignature.stderr4
-rw-r--r--testsuite/tests/partial-sigs/should_fail/PartialClassMethodSignature2.stderr4
-rw-r--r--testsuite/tests/partial-sigs/should_fail/T12039.stderr4
-rw-r--r--testsuite/tests/partial-sigs/should_fail/T13324_fail1.stderr12
-rw-r--r--testsuite/tests/partial-sigs/should_fail/UnnamedConstraintWildcard1.stderr8
-rw-r--r--testsuite/tests/partial-sigs/should_fail/UnnamedConstraintWildcard2.stderr8
-rw-r--r--testsuite/tests/partial-sigs/should_fail/WildcardInADT1.stderr4
-rw-r--r--testsuite/tests/partial-sigs/should_fail/WildcardInADT2.stderr4
-rw-r--r--testsuite/tests/partial-sigs/should_fail/WildcardInADT3.stderr4
-rw-r--r--testsuite/tests/partial-sigs/should_fail/WildcardInADTContext1.stderr4
-rw-r--r--testsuite/tests/partial-sigs/should_fail/WildcardInDefault.stderr4
-rw-r--r--testsuite/tests/partial-sigs/should_fail/WildcardInDefaultSignature.stderr4
-rw-r--r--testsuite/tests/partial-sigs/should_fail/WildcardInDeriving.stderr4
-rw-r--r--testsuite/tests/partial-sigs/should_fail/WildcardInForeignExport.stderr4
-rw-r--r--testsuite/tests/partial-sigs/should_fail/WildcardInForeignImport.stderr4
-rw-r--r--testsuite/tests/partial-sigs/should_fail/WildcardInGADT1.stderr4
-rw-r--r--testsuite/tests/partial-sigs/should_fail/WildcardInGADT2.stderr4
-rw-r--r--testsuite/tests/partial-sigs/should_fail/WildcardInInstanceHead.stderr4
-rw-r--r--testsuite/tests/partial-sigs/should_fail/WildcardInInstanceSig.stderr4
-rw-r--r--testsuite/tests/partial-sigs/should_fail/WildcardInNewtype.stderr4
-rw-r--r--testsuite/tests/partial-sigs/should_fail/WildcardInPatSynSig.stderr4
-rw-r--r--testsuite/tests/partial-sigs/should_fail/WildcardInStandaloneDeriving.stderr4
-rw-r--r--testsuite/tests/partial-sigs/should_fail/WildcardInTypeFamilyInstanceRHS.stderr4
-rw-r--r--testsuite/tests/partial-sigs/should_fail/WildcardInTypeSynonymRHS.stderr4
-rw-r--r--testsuite/tests/saks/should_fail/saks_fail003.stderr4
38 files changed, 122 insertions, 105 deletions
diff --git a/compiler/GHC/Rename/HsType.hs b/compiler/GHC/Rename/HsType.hs
index 6e1418a130..bca65c7cad 100644
--- a/compiler/GHC/Rename/HsType.hs
+++ b/compiler/GHC/Rename/HsType.hs
@@ -57,7 +57,7 @@ import GHC.Rename.Fixity ( lookupFieldFixityRn, lookupFixityRn
import GHC.Rename.Unbound ( notInScopeErr, WhereLooking(WL_LocalOnly) )
import GHC.Tc.Errors.Types
import GHC.Tc.Errors.Ppr ( pprScopeError
- , inHsDocContext, withHsDocContext, pprHsDocContext )
+ , inHsDocContext, pprHsDocContext )
import GHC.Tc.Utils.Monad
import GHC.Types.Name.Reader
import GHC.Builtin.Names
@@ -622,8 +622,9 @@ rnHsTyKi env ty@(HsQualTy { hst_ctxt = lctxt, hst_body = tau })
rnHsTyKi env (HsTyVar _ ip (L loc rdr_name))
= do { when (isRnKindLevel env && isRdrTyVar rdr_name) $
- unlessXOptM LangExt.PolyKinds $ addErr $ mkTcRnUnknownMessage $ mkPlainError noHints $
- withHsDocContext (rtke_ctxt env) $
+ unlessXOptM LangExt.PolyKinds $ addErr $
+ TcRnWithHsDocContext (rtke_ctxt env) $
+ mkTcRnUnknownMessage $ mkPlainError noHints $
vcat [ text "Unexpected kind variable" <+> quotes (ppr rdr_name)
, text "Perhaps you intended to use PolyKinds" ]
-- Any type variable at the kind level is illegal without the use
@@ -760,8 +761,9 @@ rnHsTyKi env (XHsType ty)
mb_name <- lookupLocalOccRn_maybe rdr_name
-- TODO: refactor this to avoid mkTcRnUnknownMessage
when (isNothing mb_name) $
- addErr $ mkTcRnUnknownMessage $ mkPlainError noHints $
- withHsDocContext (rtke_ctxt env) $
+ addErr $
+ TcRnWithHsDocContext (rtke_ctxt env) $
+ mkTcRnUnknownMessage $ mkPlainError noHints $
pprScopeError rdr_name (notInScopeErr WL_LocalOnly rdr_name)
rnHsTyKi env ty@(HsExplicitListTy _ ip tys)
@@ -860,7 +862,8 @@ checkWildCard :: RnTyKiEnv
-> Maybe BadAnonWildcardContext
-> RnM ()
checkWildCard env mb_name (Just bad)
- = addErr $ TcRnIllegalWildcardInType mb_name bad (Just $ rtke_ctxt env)
+ = addErr $ TcRnWithHsDocContext (rtke_ctxt env) $
+ TcRnIllegalWildcardInType mb_name bad
checkWildCard _ _ Nothing
= return ()
@@ -1658,8 +1661,9 @@ unexpectedPatSigTypeErr ty
badKindSigErr :: HsDocContext -> LHsType GhcPs -> TcM ()
badKindSigErr doc (L loc ty)
- = setSrcSpanA loc $ addErr $ mkTcRnUnknownMessage $ mkPlainError noHints $
- withHsDocContext doc $
+ = setSrcSpanA loc $ addErr $
+ TcRnWithHsDocContext doc $
+ mkTcRnUnknownMessage $ mkPlainError noHints $
hang (text "Illegal kind signature:" <+> quotes (ppr ty))
2 (text "Perhaps you intended to use KindSignatures")
diff --git a/compiler/GHC/Rename/Module.hs b/compiler/GHC/Rename/Module.hs
index 17124a9000..fa0b748cd6 100644
--- a/compiler/GHC/Rename/Module.hs
+++ b/compiler/GHC/Rename/Module.hs
@@ -38,7 +38,7 @@ import GHC.Rename.Utils ( mapFvRn, bindLocalNames
import GHC.Rename.Unbound ( mkUnboundName, notInScopeErr, WhereLooking(WL_Global) )
import GHC.Rename.Names
import GHC.Tc.Errors.Types
-import GHC.Tc.Errors.Ppr (withHsDocContext, pprScopeError )
+import GHC.Tc.Errors.Ppr (pprScopeError)
import GHC.Tc.Gen.Annotation ( annCtxt )
import GHC.Tc.Utils.Monad
@@ -681,7 +681,9 @@ rnClsInstDecl (ClsInstDecl { cid_poly_ty = inst_ty, cid_binds = mbinds
-- reach the typechecker, lest we encounter different errors that are
-- hopelessly confusing (such as the one in #16114).
bail_out (l, err_msg) = do
- addErrAt l $ mkTcRnUnknownMessage $ mkPlainError noHints (withHsDocContext ctxt err_msg)
+ addErrAt l $
+ TcRnWithHsDocContext ctxt $
+ mkTcRnUnknownMessage $ mkPlainError noHints err_msg
pure $ mkUnboundName (mkTcOccFS (fsLit "<class>"))
rnFamEqn :: HsDocContext
diff --git a/compiler/GHC/Rename/Utils.hs b/compiler/GHC/Rename/Utils.hs
index 82f9623067..f422314699 100644
--- a/compiler/GHC/Rename/Utils.hs
+++ b/compiler/GHC/Rename/Utils.hs
@@ -43,7 +43,6 @@ import GHC.Core.Type
import GHC.Hs
import GHC.Types.Name.Reader
import GHC.Tc.Errors.Types
-import GHC.Tc.Errors.Ppr (withHsDocContext)
import GHC.Tc.Utils.Env
import GHC.Tc.Utils.Monad
import GHC.Types.Error
@@ -204,7 +203,9 @@ checkInferredVars ctxt (Just msg) ty =
let bndrs = sig_ty_bndrs ty
in case find ((==) InferredSpec . hsTyVarBndrFlag) bndrs of
Nothing -> return ()
- Just _ -> addErr $ mkTcRnUnknownMessage $ mkPlainError noHints (withHsDocContext ctxt msg)
+ Just _ -> addErr $
+ TcRnWithHsDocContext ctxt $
+ mkTcRnUnknownMessage $ mkPlainError noHints msg
where
sig_ty_bndrs :: LHsSigType GhcPs -> [HsTyVarBndr Specificity GhcPs]
sig_ty_bndrs (L _ (HsSig{sig_bndrs = outer_bndrs}))
@@ -313,7 +314,9 @@ noNestedForallsContextsErr what lty =
addNoNestedForallsContextsErr :: HsDocContext -> SDoc -> LHsType GhcRn -> RnM ()
addNoNestedForallsContextsErr ctxt what lty =
whenIsJust (noNestedForallsContextsErr what lty) $ \(l, err_msg) ->
- addErrAt l $ mkTcRnUnknownMessage $ mkPlainError noHints (withHsDocContext ctxt err_msg)
+ addErrAt l $
+ TcRnWithHsDocContext ctxt $
+ mkTcRnUnknownMessage $ mkPlainError noHints err_msg
{-
************************************************************************
diff --git a/compiler/GHC/Tc/Errors/Ppr.hs b/compiler/GHC/Tc/Errors/Ppr.hs
index bb4b0718cc..5b0f08b8a1 100644
--- a/compiler/GHC/Tc/Errors/Ppr.hs
+++ b/compiler/GHC/Tc/Errors/Ppr.hs
@@ -16,7 +16,6 @@ module GHC.Tc.Errors.Ppr
, tidySkolemInfo
, tidySkolemInfoAnon
--
- , withHsDocContext
, pprHsDocContext
, inHsDocContext
, TcRnMessageOpts(..)
@@ -118,6 +117,13 @@ instance Diagnostic TcRnMessage where
-> messageWithInfoDiagnosticMessage unit_state err_info
(tcOptsShowContext opts)
(diagnosticMessage opts msg)
+ TcRnWithHsDocContext ctxt msg
+ -> if tcOptsShowContext opts
+ then main_msg `unionDecoratedSDoc` ctxt_msg
+ else main_msg
+ where
+ main_msg = diagnosticMessage opts msg
+ ctxt_msg = mkSimpleDecorated (inHsDocContext ctxt)
TcRnSolverReport msg _ _
-> mkSimpleDecorated $ pprSolverReportWithCtxt msg
TcRnRedundantConstraints redundants (info, show_info)
@@ -191,11 +197,8 @@ instance Diagnostic TcRnMessage where
-> mkSimpleDecorated $ text "Illegal use of punning for field" <+> quotes (ppr fld)
TcRnIllegalWildcardsInRecord fld_part
-> mkSimpleDecorated $ text "Illegal `..' in record" <+> pprRecordFieldPart fld_part
- TcRnIllegalWildcardInType mb_name bad mb_ctxt
- -> mkSimpleDecorated $ vcat [ main_msg, context_msg ]
- where
- main_msg :: SDoc
- main_msg = case bad of
+ TcRnIllegalWildcardInType mb_name bad
+ -> mkSimpleDecorated $ case bad of
WildcardNotLastInConstraint ->
hang notAllowed 2 constraint_hint_msg
ExtraConstraintWildcardNotAllowed allow_sole ->
@@ -206,10 +209,7 @@ instance Diagnostic TcRnMessage where
hang notAllowed 2 sole_msg
WildcardsNotAllowedAtAll ->
notAllowed
- context_msg :: SDoc
- context_msg = case mb_ctxt of
- Just ctxt -> nest 2 (text "in" <+> pprHsDocContext ctxt)
- _ -> empty
+ where
notAllowed, what, wildcard, how :: SDoc
notAllowed = what <+> quotes wildcard <+> how
wildcard = case mb_name of
@@ -1157,6 +1157,8 @@ instance Diagnostic TcRnMessage where
TcRnMessageWithInfo _ msg_with_info
-> case msg_with_info of
TcRnMessageDetailed _ m -> diagnosticReason m
+ TcRnWithHsDocContext _ msg
+ -> diagnosticReason msg
TcRnSolverReport _ reason _
-> reason -- Error, or a Warning if we are deferring type errors
TcRnRedundantConstraints {}
@@ -1523,6 +1525,8 @@ instance Diagnostic TcRnMessage where
TcRnMessageWithInfo _ msg_with_info
-> case msg_with_info of
TcRnMessageDetailed _ m -> diagnosticHints m
+ TcRnWithHsDocContext _ msg
+ -> diagnosticHints msg
TcRnSolverReport _ _ hints
-> hints
TcRnRedundantConstraints{}
@@ -3740,9 +3744,6 @@ expandSynonymsToMatch ty1 ty2 = (ty1_ret, ty2_ret)
************************************************************************
-}
-withHsDocContext :: HsDocContext -> SDoc -> SDoc
-withHsDocContext ctxt doc = doc $$ inHsDocContext ctxt
-
inHsDocContext :: HsDocContext -> SDoc
inHsDocContext ctxt = text "In" <+> pprHsDocContext ctxt
diff --git a/compiler/GHC/Tc/Errors/Types.hs b/compiler/GHC/Tc/Errors/Types.hs
index e3b3ade094..ac802272d5 100644
--- a/compiler/GHC/Tc/Errors/Types.hs
+++ b/compiler/GHC/Tc/Errors/Types.hs
@@ -216,6 +216,13 @@ data TcRnMessage where
-> !TcRnMessageDetailed
-> TcRnMessage
+ {-| TcRnWithHsDocContext annotates an error message with the context in which
+ it originated.
+ -}
+ TcRnWithHsDocContext :: !HsDocContext
+ -> !TcRnMessage
+ -> TcRnMessage
+
{-| TcRnSolverReport is the constructor used to report unsolved constraints
after constraint solving, as well as other errors such as hole fit errors.
@@ -539,7 +546,6 @@ data TcRnMessage where
:: Maybe Name
-- ^ the wildcard name, or 'Nothing' for an anonymous wildcard
-> !BadAnonWildcardContext
- -> !(Maybe HsDocContext)
-> TcRnMessage
diff --git a/compiler/GHC/Tc/Gen/HsType.hs b/compiler/GHC/Tc/Gen/HsType.hs
index 19ea11f2d4..77aa280af8 100644
--- a/compiler/GHC/Tc/Gen/HsType.hs
+++ b/compiler/GHC/Tc/Gen/HsType.hs
@@ -2224,7 +2224,7 @@ tcAnonWildCardOcc is_extra _ _ _
-- in an unexpected place. The renamer rejects these wildcards in 'checkAnonWildcard',
-- but it is possible for a wildcard to be introduced by a Template Haskell splice,
-- as per #15433. To account for this, we throw a generic catch-all error message.
- = failWith $ TcRnIllegalWildcardInType Nothing reason Nothing
+ = failWith $ TcRnIllegalWildcardInType Nothing reason
where
reason =
case is_extra of
diff --git a/compiler/GHC/Types/Error/Codes.hs b/compiler/GHC/Types/Error/Codes.hs
index 2e919ef61f..4c13126699 100644
--- a/compiler/GHC/Types/Error/Codes.hs
+++ b/compiler/GHC/Types/Error/Codes.hs
@@ -629,6 +629,7 @@ type family ConRecursInto con where
-- Recur into TcRnMessageWithInfo to get the underlying TcRnMessage
ConRecursInto "TcRnMessageWithInfo" = 'Just TcRnMessageDetailed
ConRecursInto "TcRnMessageDetailed" = 'Just TcRnMessage
+ ConRecursInto "TcRnWithHsDocContext" = 'Just TcRnMessage
ConRecursInto "TcRnCannotDeriveInstance" = 'Just DeriveInstanceErrReason
ConRecursInto "TcRnPragmaWarning" = 'Just (WarningTxt GhcRn)
diff --git a/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInPatternSignature.stderr b/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInPatternSignature.stderr
index 4d161fb837..b2a54c8fcb 100644
--- a/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInPatternSignature.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInPatternSignature.stderr
@@ -1,4 +1,4 @@
ExtraConstraintsWildcardInPatternSignature.hs:4:11: error: [GHC-65507]
- Extra-constraint wildcard ‘_’ not allowed
- in a pattern type-signature
+ • Extra-constraint wildcard ‘_’ not allowed
+ • In a pattern type-signature
diff --git a/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInTypeSpliceUsed.stderr b/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInTypeSpliceUsed.stderr
index a4999fa6c8..48e225de84 100644
--- a/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInTypeSpliceUsed.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInTypeSpliceUsed.stderr
@@ -4,5 +4,5 @@ ExtraConstraintsWildcardInTypeSplice.hs:7:16: error: [GHC-65507]
• Wildcard ‘_’ not allowed in a constraint
except as the last top-level constraint of a type signature
e.g f :: (Eq a, _) => blah
- in a Template-Haskell quoted type
+ • In a Template-Haskell quoted type
• In the Template Haskell quotation [t| _ => _ |]
diff --git a/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardNotLast.stderr b/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardNotLast.stderr
index 5a76f15720..cdedfa6f54 100644
--- a/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardNotLast.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardNotLast.stderr
@@ -1,6 +1,6 @@
ExtraConstraintsWildcardNotLast.hs:4:9: error: [GHC-65507]
- Wildcard ‘_’ not allowed in a constraint
- except as the last top-level constraint of a type signature
- e.g f :: (Eq a, _) => blah
- in the type signature for ‘foo’
+ • Wildcard ‘_’ not allowed in a constraint
+ except as the last top-level constraint of a type signature
+ e.g f :: (Eq a, _) => blah
+ • In the type signature for ‘foo’
diff --git a/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardTwice.stderr b/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardTwice.stderr
index 2574f141f0..d9487fac1d 100644
--- a/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardTwice.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardTwice.stderr
@@ -1,6 +1,6 @@
ExtraConstraintsWildcardTwice.hs:4:10: error: [GHC-65507]
- Wildcard ‘_’ not allowed in a constraint
- except as the last top-level constraint of a type signature
- e.g f :: (Eq a, _) => blah
- in the type signature for ‘foo’
+ • Wildcard ‘_’ not allowed in a constraint
+ except as the last top-level constraint of a type signature
+ e.g f :: (Eq a, _) => blah
+ • In the type signature for ‘foo’
diff --git a/testsuite/tests/partial-sigs/should_fail/NestedExtraConstraintsWildcard.stderr b/testsuite/tests/partial-sigs/should_fail/NestedExtraConstraintsWildcard.stderr
index 9bba4ecb14..4684dd8900 100644
--- a/testsuite/tests/partial-sigs/should_fail/NestedExtraConstraintsWildcard.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/NestedExtraConstraintsWildcard.stderr
@@ -1,6 +1,6 @@
NestedExtraConstraintsWildcard.hs:4:23: error: [GHC-65507]
- Wildcard ‘_’ not allowed in a constraint
- except as the last top-level constraint of a type signature
- e.g f :: (Eq a, _) => blah
- in the type signature for ‘foo’
+ • Wildcard ‘_’ not allowed in a constraint
+ except as the last top-level constraint of a type signature
+ e.g f :: (Eq a, _) => blah
+ • In the type signature for ‘foo’
diff --git a/testsuite/tests/partial-sigs/should_fail/NestedNamedExtraConstraintsWildcard.stderr b/testsuite/tests/partial-sigs/should_fail/NestedNamedExtraConstraintsWildcard.stderr
index 85ba3842dc..eec710545e 100644
--- a/testsuite/tests/partial-sigs/should_fail/NestedNamedExtraConstraintsWildcard.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/NestedNamedExtraConstraintsWildcard.stderr
@@ -1,6 +1,6 @@
NestedNamedExtraConstraintsWildcard.hs:4:23: error: [GHC-65507]
- Named wildcard ‘_a’ not allowed in a constraint
- Extra-constraint wildcards must be anonymous
- e.g f :: (Eq a, _) => blah
- in the type signature for ‘foo’
+ • Named wildcard ‘_a’ not allowed in a constraint
+ Extra-constraint wildcards must be anonymous
+ e.g f :: (Eq a, _) => blah
+ • In the type signature for ‘foo’
diff --git a/testsuite/tests/partial-sigs/should_fail/PartialClassMethodSignature.stderr b/testsuite/tests/partial-sigs/should_fail/PartialClassMethodSignature.stderr
index b8790d81f4..9a06ff66ad 100644
--- a/testsuite/tests/partial-sigs/should_fail/PartialClassMethodSignature.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/PartialClassMethodSignature.stderr
@@ -1,4 +1,4 @@
PartialClassMethodSignature.hs:6:15: error: [GHC-65507]
- Wildcard ‘_’ not allowed
- in a class method signature for ‘foo’
+ • Wildcard ‘_’ not allowed
+ • In a class method signature for ‘foo’
diff --git a/testsuite/tests/partial-sigs/should_fail/PartialClassMethodSignature2.stderr b/testsuite/tests/partial-sigs/should_fail/PartialClassMethodSignature2.stderr
index c989ee27c0..40897e3b8a 100644
--- a/testsuite/tests/partial-sigs/should_fail/PartialClassMethodSignature2.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/PartialClassMethodSignature2.stderr
@@ -1,4 +1,4 @@
PartialClassMethodSignature2.hs:5:17: error: [GHC-65507]
- Wildcard ‘_’ not allowed
- in a class method signature for ‘foo’
+ • Wildcard ‘_’ not allowed
+ • In a class method signature for ‘foo’
diff --git a/testsuite/tests/partial-sigs/should_fail/T12039.stderr b/testsuite/tests/partial-sigs/should_fail/T12039.stderr
index 690224f32d..8995c51b6d 100644
--- a/testsuite/tests/partial-sigs/should_fail/T12039.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/T12039.stderr
@@ -1,4 +1,4 @@
T12039.hs:5:11: error: [GHC-65507]
- Wildcard ‘_’ not allowed
- in the declaration for class ‘B’
+ • Wildcard ‘_’ not allowed
+ • In the declaration for class ‘B’
diff --git a/testsuite/tests/partial-sigs/should_fail/T13324_fail1.stderr b/testsuite/tests/partial-sigs/should_fail/T13324_fail1.stderr
index 92e8613b7d..e323e178df 100644
--- a/testsuite/tests/partial-sigs/should_fail/T13324_fail1.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/T13324_fail1.stderr
@@ -1,10 +1,10 @@
T13324_fail1.hs:7:26: error: [GHC-65507]
- Extra-constraint wildcard ‘_’ not allowed
- except as the sole constraint
- e.g., deriving instance _ => Eq (Foo a)
- in a deriving declaration
+ • Extra-constraint wildcard ‘_’ not allowed
+ except as the sole constraint
+ e.g., deriving instance _ => Eq (Foo a)
+ • In a deriving declaration
T13324_fail1.hs:8:25: error: [GHC-65507]
- Wildcard ‘_’ not allowed
- in a deriving declaration
+ • Wildcard ‘_’ not allowed
+ • In a deriving declaration
diff --git a/testsuite/tests/partial-sigs/should_fail/UnnamedConstraintWildcard1.stderr b/testsuite/tests/partial-sigs/should_fail/UnnamedConstraintWildcard1.stderr
index 8576e0f5df..c53d52d912 100644
--- a/testsuite/tests/partial-sigs/should_fail/UnnamedConstraintWildcard1.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/UnnamedConstraintWildcard1.stderr
@@ -1,6 +1,6 @@
UnnamedConstraintWildcard1.hs:4:13: error: [GHC-65507]
- Wildcard ‘_’ not allowed in a constraint
- except as the last top-level constraint of a type signature
- e.g f :: (Eq a, _) => blah
- in the type signature for ‘foo’
+ • Wildcard ‘_’ not allowed in a constraint
+ except as the last top-level constraint of a type signature
+ e.g f :: (Eq a, _) => blah
+ • In the type signature for ‘foo’
diff --git a/testsuite/tests/partial-sigs/should_fail/UnnamedConstraintWildcard2.stderr b/testsuite/tests/partial-sigs/should_fail/UnnamedConstraintWildcard2.stderr
index 8becad9a96..6807d90147 100644
--- a/testsuite/tests/partial-sigs/should_fail/UnnamedConstraintWildcard2.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/UnnamedConstraintWildcard2.stderr
@@ -1,6 +1,6 @@
UnnamedConstraintWildcard2.hs:4:8: error: [GHC-65507]
- Wildcard ‘_’ not allowed in a constraint
- except as the last top-level constraint of a type signature
- e.g f :: (Eq a, _) => blah
- in the type signature for ‘foo’
+ • Wildcard ‘_’ not allowed in a constraint
+ except as the last top-level constraint of a type signature
+ e.g f :: (Eq a, _) => blah
+ • In the type signature for ‘foo’
diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInADT1.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInADT1.stderr
index b82dd1ef4f..916bb5e71a 100644
--- a/testsuite/tests/partial-sigs/should_fail/WildcardInADT1.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/WildcardInADT1.stderr
@@ -1,4 +1,4 @@
WildcardInADT1.hs:4:26: error: [GHC-65507]
- Wildcard ‘_’ not allowed
- in the definition of data constructor ‘Foo’
+ • Wildcard ‘_’ not allowed
+ • In the definition of data constructor ‘Foo’
diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInADT2.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInADT2.stderr
index 6537262707..aa4044a794 100644
--- a/testsuite/tests/partial-sigs/should_fail/WildcardInADT2.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/WildcardInADT2.stderr
@@ -1,4 +1,4 @@
WildcardInADT2.hs:4:34: error: [GHC-65507]
- Wildcard ‘_’ not allowed
- in the definition of data constructor ‘Foo’
+ • Wildcard ‘_’ not allowed
+ • In the definition of data constructor ‘Foo’
diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInADT3.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInADT3.stderr
index fe2f70d008..1758cdac89 100644
--- a/testsuite/tests/partial-sigs/should_fail/WildcardInADT3.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/WildcardInADT3.stderr
@@ -1,4 +1,4 @@
WildcardInADT3.hs:4:27: error: [GHC-65507]
- Wildcard ‘_’ not allowed
- in the definition of data constructor ‘Foo’
+ • Wildcard ‘_’ not allowed
+ • In the definition of data constructor ‘Foo’
diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInADTContext1.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInADTContext1.stderr
index e1ab864988..730bc1b147 100644
--- a/testsuite/tests/partial-sigs/should_fail/WildcardInADTContext1.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/WildcardInADTContext1.stderr
@@ -3,5 +3,5 @@ WildcardInADTContext1.hs:1:37: warning: [-Wdeprecated-flags (in -Wdefault)]
-XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
WildcardInADTContext1.hs:4:13: error: [GHC-65507]
- Wildcard ‘_’ not allowed
- in the data type declaration for ‘Foo’
+ • Wildcard ‘_’ not allowed
+ • In the data type declaration for ‘Foo’
diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInDefault.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInDefault.stderr
index 1cb3b46f8e..89ed51d003 100644
--- a/testsuite/tests/partial-sigs/should_fail/WildcardInDefault.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/WildcardInDefault.stderr
@@ -1,4 +1,4 @@
WildcardInDefault.hs:4:10: error: [GHC-65507]
- Wildcard ‘_’ not allowed
- in a `default' declaration
+ • Wildcard ‘_’ not allowed
+ • In a `default' declaration
diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInDefaultSignature.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInDefaultSignature.stderr
index 98913a6f8b..5b9c41deca 100644
--- a/testsuite/tests/partial-sigs/should_fail/WildcardInDefaultSignature.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/WildcardInDefaultSignature.stderr
@@ -1,4 +1,4 @@
WildcardInDefaultSignature.hs:7:16: error: [GHC-65507]
- Wildcard ‘_’ not allowed
- in a class method signature for ‘f’
+ • Wildcard ‘_’ not allowed
+ • In a class method signature for ‘f’
diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInDeriving.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInDeriving.stderr
index 68d01bb0f1..1d790383d8 100644
--- a/testsuite/tests/partial-sigs/should_fail/WildcardInDeriving.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/WildcardInDeriving.stderr
@@ -1,4 +1,4 @@
WildcardInDeriving.hs:5:22: error: [GHC-65507]
- Wildcard ‘_’ not allowed
- in the data type declaration for ‘Foo’
+ • Wildcard ‘_’ not allowed
+ • In the data type declaration for ‘Foo’
diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInForeignExport.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInForeignExport.stderr
index ede183a2bd..7423d8da28 100644
--- a/testsuite/tests/partial-sigs/should_fail/WildcardInForeignExport.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/WildcardInForeignExport.stderr
@@ -1,4 +1,4 @@
WildcardInForeignExport.hs:6:37: error: [GHC-65507]
- Wildcard ‘_’ not allowed
- in the foreign declaration for ‘foo’
+ • Wildcard ‘_’ not allowed
+ • In the foreign declaration for ‘foo’
diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInForeignImport.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInForeignImport.stderr
index dc9daedfba..a44ba06e7f 100644
--- a/testsuite/tests/partial-sigs/should_fail/WildcardInForeignImport.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/WildcardInForeignImport.stderr
@@ -1,4 +1,4 @@
WildcardInForeignImport.hs:6:48: error: [GHC-65507]
- Wildcard ‘_’ not allowed
- in the foreign declaration for ‘c_sin’
+ • Wildcard ‘_’ not allowed
+ • In the foreign declaration for ‘c_sin’
diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInGADT1.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInGADT1.stderr
index 41d5c582be..f7bcece6d2 100644
--- a/testsuite/tests/partial-sigs/should_fail/WildcardInGADT1.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/WildcardInGADT1.stderr
@@ -1,4 +1,4 @@
WildcardInGADT1.hs:5:19: error: [GHC-65507]
- Wildcard ‘_’ not allowed
- in the definition of data constructor ‘Foo’
+ • Wildcard ‘_’ not allowed
+ • In the definition of data constructor ‘Foo’
diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInGADT2.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInGADT2.stderr
index 85dba04ad9..d2e338af49 100644
--- a/testsuite/tests/partial-sigs/should_fail/WildcardInGADT2.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/WildcardInGADT2.stderr
@@ -1,4 +1,4 @@
WildcardInGADT2.hs:5:17: error: [GHC-65507]
- Wildcard ‘_’ not allowed
- in the definition of data constructor ‘Foo’
+ • Wildcard ‘_’ not allowed
+ • In the definition of data constructor ‘Foo’
diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInInstanceHead.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInInstanceHead.stderr
index 718f136e46..4b2d2872c1 100644
--- a/testsuite/tests/partial-sigs/should_fail/WildcardInInstanceHead.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/WildcardInInstanceHead.stderr
@@ -1,4 +1,4 @@
WildcardInInstanceHead.hs:7:14: error: [GHC-65507]
- Wildcard ‘_’ not allowed
- in an instance declaration
+ • Wildcard ‘_’ not allowed
+ • In an instance declaration
diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInInstanceSig.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInInstanceSig.stderr
index 466d971bd8..1aa4d18abf 100644
--- a/testsuite/tests/partial-sigs/should_fail/WildcardInInstanceSig.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/WildcardInInstanceSig.stderr
@@ -1,4 +1,4 @@
WildcardInInstanceSig.hs:5:13: error: [GHC-65507]
- Wildcard ‘_’ not allowed
- in a class method signature for ‘negate’
+ • Wildcard ‘_’ not allowed
+ • In a class method signature for ‘negate’
diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInNewtype.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInNewtype.stderr
index ce46867a6a..e6e4d42742 100644
--- a/testsuite/tests/partial-sigs/should_fail/WildcardInNewtype.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/WildcardInNewtype.stderr
@@ -1,4 +1,4 @@
WildcardInNewtype.hs:7:29: error: [GHC-65507]
- Wildcard ‘_’ not allowed
- in the definition of data constructor ‘Foo’
+ • Wildcard ‘_’ not allowed
+ • In the definition of data constructor ‘Foo’
diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInPatSynSig.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInPatSynSig.stderr
index ed517a0232..67134f5494 100644
--- a/testsuite/tests/partial-sigs/should_fail/WildcardInPatSynSig.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/WildcardInPatSynSig.stderr
@@ -1,4 +1,4 @@
WildcardInPatSynSig.hs:4:37: error: [GHC-65507]
- Wildcard ‘_’ not allowed
- in a pattern synonym signature for ‘Single’
+ • Wildcard ‘_’ not allowed
+ • In a pattern synonym signature for ‘Single’
diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInStandaloneDeriving.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInStandaloneDeriving.stderr
index 2af068b5a0..ae625f164e 100644
--- a/testsuite/tests/partial-sigs/should_fail/WildcardInStandaloneDeriving.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/WildcardInStandaloneDeriving.stderr
@@ -1,4 +1,4 @@
WildcardInStandaloneDeriving.hs:4:19: error: [GHC-65507]
- Wildcard ‘_’ not allowed
- in a deriving declaration
+ • Wildcard ‘_’ not allowed
+ • In a deriving declaration
diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInTypeFamilyInstanceRHS.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInTypeFamilyInstanceRHS.stderr
index 3edb17a99a..c499aa4a37 100644
--- a/testsuite/tests/partial-sigs/should_fail/WildcardInTypeFamilyInstanceRHS.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/WildcardInTypeFamilyInstanceRHS.stderr
@@ -1,4 +1,4 @@
WildcardInTypeFamilyInstanceRHS.hs:8:25: error: [GHC-65507]
- Wildcard ‘_’ not allowed
- in the declaration for type synonym ‘Dual’
+ • Wildcard ‘_’ not allowed
+ • In the declaration for type synonym ‘Dual’
diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInTypeSynonymRHS.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInTypeSynonymRHS.stderr
index b16f3ffb08..ca1501620a 100644
--- a/testsuite/tests/partial-sigs/should_fail/WildcardInTypeSynonymRHS.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/WildcardInTypeSynonymRHS.stderr
@@ -1,4 +1,4 @@
WildcardInTypeSynonymRHS.hs:4:18: error: [GHC-65507]
- Wildcard ‘_’ not allowed
- in the declaration for type synonym ‘Foo’
+ • Wildcard ‘_’ not allowed
+ • In the declaration for type synonym ‘Foo’
diff --git a/testsuite/tests/saks/should_fail/saks_fail003.stderr b/testsuite/tests/saks/should_fail/saks_fail003.stderr
index 92221896d8..605f1fd638 100644
--- a/testsuite/tests/saks/should_fail/saks_fail003.stderr
+++ b/testsuite/tests/saks/should_fail/saks_fail003.stderr
@@ -1,4 +1,4 @@
saks_fail003.hs:6:11: error: [GHC-65507]
- Wildcard ‘_’ not allowed
- in the standalone kind signature for T
+ • Wildcard ‘_’ not allowed
+ • In the standalone kind signature for T