diff options
Diffstat (limited to 'compiler/GHC/Tc')
-rw-r--r-- | compiler/GHC/Tc/Errors/Ppr.hs | 9 | ||||
-rw-r--r-- | compiler/GHC/Tc/Errors/Types.hs | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/compiler/GHC/Tc/Errors/Ppr.hs b/compiler/GHC/Tc/Errors/Ppr.hs index 2e17295073..984cf95903 100644 --- a/compiler/GHC/Tc/Errors/Ppr.hs +++ b/compiler/GHC/Tc/Errors/Ppr.hs @@ -718,6 +718,11 @@ instance Diagnostic TcRnMessage where TcRnNotInScope err name imp_errs _ -> mkSimpleDecorated $ pprScopeError name err $$ vcat (map ppr imp_errs) + TcRnTermNameInType name _ + -> mkSimpleDecorated $ + quotes (ppr name) <+> + (text "is a term-level binding") $+$ + (text " and can not be used at the type level.") TcRnUntickedPromotedThing thing -> mkSimpleDecorated $ text "Unticked promoted" <+> what @@ -1475,6 +1480,8 @@ instance Diagnostic TcRnMessage where -> ErrorWithoutFlag TcRnNotInScope {} -> ErrorWithoutFlag + TcRnTermNameInType {} + -> ErrorWithoutFlag TcRnUntickedPromotedThing {} -> WarningWithFlag Opt_WarnUntickedPromotedConstructors TcRnIllegalBuiltinSyntax {} @@ -1878,6 +1885,8 @@ instance Diagnostic TcRnMessage where -> noHints TcRnNotInScope err _ _ hints -> scopeErrorHints err ++ hints + TcRnTermNameInType _ hints + -> hints TcRnUntickedPromotedThing thing -> [SuggestAddTick thing] TcRnIllegalBuiltinSyntax {} diff --git a/compiler/GHC/Tc/Errors/Types.hs b/compiler/GHC/Tc/Errors/Types.hs index 13bef7b699..65701f9fee 100644 --- a/compiler/GHC/Tc/Errors/Types.hs +++ b/compiler/GHC/Tc/Errors/Types.hs @@ -1717,6 +1717,7 @@ data TcRnMessage where -> [ImportError] -- ^ import errors that are relevant -> [GhcHint] -- ^ hints, e.g. enable DataKinds to refer to a promoted data constructor -> TcRnMessage + TcRnTermNameInType :: RdrName -> [GhcHint] -> TcRnMessage {-| TcRnUntickedPromotedThing is a warning (controlled with -Wunticked-promoted-constructors) that is triggered by an unticked occurrence of a promoted data constructor. |