summaryrefslogtreecommitdiff
path: root/compiler/GHC/Rename
diff options
context:
space:
mode:
authorAlfredo Di Napoli <alfredo@well-typed.com>2021-07-06 15:26:53 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-07-09 08:46:44 -0400
commit60fabd7eb3e3450636673d818075da19074ddad0 (patch)
tree4a018f4c5ffdfb03ad04fd0df6e187c6782a0507 /compiler/GHC/Rename
parent64e205219fe70a724bcf4558839beaaeb41b2780 (diff)
downloadhaskell-60fabd7eb3e3450636673d818075da19074ddad0.tar.gz
Add TcRnIllegalWildcardsInConstructor to TcRnMessage
Diffstat (limited to 'compiler/GHC/Rename')
-rw-r--r--compiler/GHC/Rename/Pat.hs8
1 files changed, 1 insertions, 7 deletions
diff --git a/compiler/GHC/Rename/Pat.hs b/compiler/GHC/Rename/Pat.hs
index f68aceaf84..28e4c806a1 100644
--- a/compiler/GHC/Rename/Pat.hs
+++ b/compiler/GHC/Rename/Pat.hs
@@ -806,7 +806,7 @@ rnHsRecFields ctxt mk_arg (HsRecFields { rec_flds = flds, rec_dotdot = dotdot })
; checkErr dd_flag (needFlagDotDot ctxt)
; (rdr_env, lcl_env) <- getRdrEnvs
; con_fields <- lookupConstructorFields con
- ; when (null con_fields) (addErr (badDotDotCon con))
+ ; when (null con_fields) (addErr (TcRnIllegalWildcardsInConstructor con))
; let present_flds = mkOccSet $ map rdrNameOcc (getFieldLbls flds)
-- For constructor uses (but not patterns)
@@ -924,12 +924,6 @@ getFieldUpdLbls flds = map (rdrNameAmbiguousFieldOcc . unLoc . hfbLHS . unLoc) f
needFlagDotDot :: HsRecFieldContext -> TcRnMessage
needFlagDotDot = TcRnIllegalWildcardsInRecord . toRecordFieldPart
-badDotDotCon :: Name -> TcRnMessage
-badDotDotCon con
- = TcRnUnknownMessage $ mkPlainError noHints $
- vcat [ text "Illegal `..' notation for constructor" <+> quotes (ppr con)
- , nest 2 (text "The constructor has no labelled fields") ]
-
dupFieldErr :: HsRecFieldContext -> NE.NonEmpty RdrName -> TcRnMessage
dupFieldErr ctxt = TcRnDuplicateFieldName (toRecordFieldPart ctxt)