From e17850c4b9b988809dafbd6a35c7b3c3bf050dd5 Mon Sep 17 00:00:00 2001 From: Alfredo Di Napoli Date: Tue, 6 Jul 2021 12:48:49 +0200 Subject: Add TcRnDuplicateFieldName to TcRnMessage --- compiler/GHC/Rename/Pat.hs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'compiler/GHC/Rename/Pat.hs') diff --git a/compiler/GHC/Rename/Pat.hs b/compiler/GHC/Rename/Pat.hs index b3aabc6942..eef23cf56d 100644 --- a/compiler/GHC/Rename/Pat.hs +++ b/compiler/GHC/Rename/Pat.hs @@ -934,16 +934,7 @@ badDotDotCon con , nest 2 (text "The constructor has no labelled fields") ] dupFieldErr :: HsRecFieldContext -> NE.NonEmpty RdrName -> TcRnMessage -dupFieldErr ctxt dups - = TcRnUnknownMessage $ mkPlainError noHints $ - hsep [text "duplicate field name", - quotes (ppr (NE.head dups)), - text "in record", pprRFC ctxt] - -pprRFC :: HsRecFieldContext -> SDoc -pprRFC (HsRecFieldCon {}) = text "construction" -pprRFC (HsRecFieldPat {}) = text "pattern" -pprRFC (HsRecFieldUpd {}) = text "update" +dupFieldErr ctxt = TcRnDuplicateFieldName (toRecordFieldPart ctxt) toRecordFieldPart :: HsRecFieldContext -> RecordFieldPart toRecordFieldPart (HsRecFieldCon n) = RecordFieldConstructor n -- cgit v1.2.1