summaryrefslogtreecommitdiff
path: root/compiler/GHC/Tc/Gen/Default.hs
diff options
context:
space:
mode:
authorAaron Allen <aaron@flipstone.com>2021-08-05 21:13:43 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-09-22 08:23:45 -0400
commitbb37026e3547af569db6dce021b59f4d0ac70910 (patch)
tree472633d4623fa91244f5104b15d78bb696c8146c /compiler/GHC/Tc/Gen/Default.hs
parent104bf6bfa0d52f6b51992df98dcc17232fc7b75d (diff)
downloadhaskell-bb37026e3547af569db6dce021b59f4d0ac70910.tar.gz
Convert Diagnostics in GHC.Tc.Gen.* (Part 2)
Converts diagnostics in: (#20116) - GHC.Tc.Gen.Default - GHC.Tc.Gen.Export
Diffstat (limited to 'compiler/GHC/Tc/Gen/Default.hs')
-rw-r--r--compiler/GHC/Tc/Gen/Default.hs16
1 files changed, 2 insertions, 14 deletions
diff --git a/compiler/GHC/Tc/Gen/Default.hs b/compiler/GHC/Tc/Gen/Default.hs
index 1390c2bdad..15f2bdd440 100644
--- a/compiler/GHC/Tc/Gen/Default.hs
+++ b/compiler/GHC/Tc/Gen/Default.hs
@@ -81,7 +81,7 @@ tc_default_ty deflt_clss hs_ty
-- Check that the type is an instance of at least one of the deflt_clss
; oks <- mapM (check_instance ty) deflt_clss
- ; checkTc (or oks) (badDefaultTy ty deflt_clss)
+ ; checkTc (or oks) (TcRnBadDefaultType ty deflt_clss)
; return ty }
check_instance :: Type -> Class -> TcM Bool
@@ -105,17 +105,5 @@ defaultDeclCtxt = text "When checking the types in a default declaration"
dupDefaultDeclErr :: [LDefaultDecl GhcRn] -> TcRnMessage
dupDefaultDeclErr (L _ (DefaultDecl _ _) : dup_things)
- = TcRnUnknownMessage $ mkPlainError noHints $
- hang (text "Multiple default declarations")
- 2 (vcat (map pp dup_things))
- where
- pp :: LDefaultDecl GhcRn -> SDoc
- pp (L locn (DefaultDecl _ _))
- = text "here was another default declaration" <+> ppr (locA locn)
+ = TcRnMultipleDefaultDeclarations dup_things
dupDefaultDeclErr [] = panic "dupDefaultDeclErr []"
-
-badDefaultTy :: Type -> [Class] -> TcRnMessage
-badDefaultTy ty deflt_clss
- = TcRnUnknownMessage $ mkPlainError noHints $
- hang (text "The default type" <+> quotes (ppr ty) <+> text "is not an instance of")
- 2 (foldr1 (\a b -> a <+> text "or" <+> b) (map (quotes. ppr) deflt_clss))