summaryrefslogtreecommitdiff
path: root/compiler/GHC/Rename
diff options
context:
space:
mode:
authorAlfredo Di Napoli <alfredo@well-typed.com>2021-07-06 12:35:36 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-07-09 08:46:44 -0400
commit5193bd06c09009ebd2797a6674b458ec4b70248b (patch)
tree528b8a448b044e12233fed170cd7509733fa7b60 /compiler/GHC/Rename
parentf0a02dcc7517452246cd2f3f874b48d91bd68a68 (diff)
downloadhaskell-5193bd06c09009ebd2797a6674b458ec4b70248b.tar.gz
Add TcRnIllegalWildCardsInRecord to TcRnMessage
Diffstat (limited to 'compiler/GHC/Rename')
-rw-r--r--compiler/GHC/Rename/Pat.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/GHC/Rename/Pat.hs b/compiler/GHC/Rename/Pat.hs
index 9129a46a8a..b3aabc6942 100644
--- a/compiler/GHC/Rename/Pat.hs
+++ b/compiler/GHC/Rename/Pat.hs
@@ -925,9 +925,7 @@ getFieldUpdLbls :: [LHsRecUpdField GhcPs] -> [RdrName]
getFieldUpdLbls flds = map (rdrNameAmbiguousFieldOcc . unLoc . hfbLHS . unLoc) flds
needFlagDotDot :: HsRecFieldContext -> TcRnMessage
-needFlagDotDot ctxt = TcRnUnknownMessage $ mkPlainError noHints $
- vcat [text "Illegal `..' in record" <+> pprRFC ctxt,
- text "Use RecordWildCards to permit this"]
+needFlagDotDot = TcRnIllegalWildcardsInRecord . toRecordFieldPart
badDotDotCon :: Name -> TcRnMessage
badDotDotCon con
@@ -947,6 +945,11 @@ pprRFC (HsRecFieldCon {}) = text "construction"
pprRFC (HsRecFieldPat {}) = text "pattern"
pprRFC (HsRecFieldUpd {}) = text "update"
+toRecordFieldPart :: HsRecFieldContext -> RecordFieldPart
+toRecordFieldPart (HsRecFieldCon n) = RecordFieldConstructor n
+toRecordFieldPart (HsRecFieldPat n) = RecordFieldPattern n
+toRecordFieldPart (HsRecFieldUpd {}) = RecordFieldUpdate
+
{-
************************************************************************
* *