summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsheaf <sam.derbyshire@gmail.com>2023-05-15 11:06:20 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-05-15 14:49:17 -0400
commit5ae81842d36a6091b406bfce98c60e8a7fa24240 (patch)
tree97055026d85f6ee1ff9fbdd51a89ec7dae6509d1
parente305e60cf507808fa31c456ef98295f8f7d00c9d (diff)
downloadhaskell-5ae81842d36a6091b406bfce98c60e8a7fa24240.tar.gz
Improve "ambiguous occurrence" error messages
This error was sometimes a bit confusing, especially when data families were involved. This commit improves the general presentation of the "ambiguous occurrence" error, and adds a bit of extra context in the case of data families. Fixes #23301
-rw-r--r--compiler/GHC/Rename/Utils.hs11
-rw-r--r--compiler/GHC/Tc/Errors/Ppr.hs59
-rw-r--r--compiler/GHC/Tc/Errors/Types.hs3
-rw-r--r--compiler/GHC/Tc/Module.hs3
-rw-r--r--compiler/GHC/Utils/Outputable.hs21
-rw-r--r--testsuite/tests/module/mod110.stderr11
-rw-r--r--testsuite/tests/module/mod151.stderr11
-rw-r--r--testsuite/tests/module/mod152.stderr11
-rw-r--r--testsuite/tests/module/mod153.stderr11
-rw-r--r--testsuite/tests/module/mod164.stderr17
-rw-r--r--testsuite/tests/module/mod165.stderr10
-rw-r--r--testsuite/tests/overloadedrecflds/ghci/GHCiDRF.stdout26
-rw-r--r--testsuite/tests/overloadedrecflds/ghci/duplicaterecfldsghci01.stdout8
-rw-r--r--testsuite/tests/overloadedrecflds/should_compile/BootFldReexport.stderr6
-rw-r--r--testsuite/tests/overloadedrecflds/should_fail/DRFUnused.stderr11
-rw-r--r--testsuite/tests/overloadedrecflds/should_fail/NoFieldSelectorsFail.stderr6
-rw-r--r--testsuite/tests/overloadedrecflds/should_fail/T11167_ambiguous_fixity.stderr8
-rw-r--r--testsuite/tests/overloadedrecflds/should_fail/T13132_duplicaterecflds.stderr12
-rw-r--r--testsuite/tests/overloadedrecflds/should_fail/T16745.stderr6
-rw-r--r--testsuite/tests/overloadedrecflds/should_fail/T17420.stderr6
-rw-r--r--testsuite/tests/overloadedrecflds/should_fail/T18999_NoDisambiguateRecordFields.stderr6
-rw-r--r--testsuite/tests/overloadedrecflds/should_fail/T23010_fail.stderr6
-rw-r--r--testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail02.stderr6
-rw-r--r--testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail04.stderr6
-rw-r--r--testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail11.stderr6
-rw-r--r--testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail12.stderr12
-rw-r--r--testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail13.stderr24
-rw-r--r--testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldswasrunnowfail06.stderr32
-rw-r--r--testsuite/tests/rename/should_fail/T11167_ambig.stderr12
-rw-r--r--testsuite/tests/rename/should_fail/T15487.stderr6
-rw-r--r--testsuite/tests/rename/should_fail/T23301.hs9
-rw-r--r--testsuite/tests/rename/should_fail/T23301.stderr10
-rw-r--r--testsuite/tests/rename/should_fail/all.T1
-rw-r--r--testsuite/tests/rename/should_fail/rnfail044.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/T19397E1.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/T19397E2.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail037.stderr11
37 files changed, 251 insertions, 171 deletions
diff --git a/compiler/GHC/Rename/Utils.hs b/compiler/GHC/Rename/Utils.hs
index 7b631edac0..5c23ee60cb 100644
--- a/compiler/GHC/Rename/Utils.hs
+++ b/compiler/GHC/Rename/Utils.hs
@@ -60,9 +60,11 @@ import GHC.Driver.Session
import GHC.Data.FastString
import Control.Monad
import GHC.Settings.Constants ( mAX_TUPLE_SIZE, mAX_CTUPLE_SIZE )
-import qualified Data.List.NonEmpty as NE
import qualified GHC.LanguageExtensions as LangExt
+
import qualified Data.List as List
+import qualified Data.List.NonEmpty as NE
+
{-
*********************************************************
@@ -501,7 +503,8 @@ addNameClashErrRn rdr_name gres
-- already, and we don't want an error cascade.
= return ()
| otherwise
- = addErr $ mkNameClashErr rdr_name gres
+ = do { gre_env <- getGlobalRdrEnv
+ ; addErr $ mkNameClashErr gre_env rdr_name gres }
where
-- If all the GREs are defined locally, can we skip reporting an ambiguity
-- error at use sites, because it will have been reported already? See
@@ -514,8 +517,8 @@ addNameClashErrRn rdr_name gres
num_flds = length flds
num_non_flds = length non_flds
-mkNameClashErr :: RdrName -> NE.NonEmpty GlobalRdrElt -> TcRnMessage
-mkNameClashErr rdr_name gres = TcRnAmbiguousName rdr_name gres
+mkNameClashErr :: GlobalRdrEnv -> RdrName -> NE.NonEmpty GlobalRdrElt -> TcRnMessage
+mkNameClashErr gre_env rdr_name gres = TcRnAmbiguousName gre_env rdr_name gres
dupNamesErr :: NE.NonEmpty SrcSpan -> NE.NonEmpty RdrName -> RnM ()
dupNamesErr locs names
diff --git a/compiler/GHC/Tc/Errors/Ppr.hs b/compiler/GHC/Tc/Errors/Ppr.hs
index 269063ae65..5a1485c1da 100644
--- a/compiler/GHC/Tc/Errors/Ppr.hs
+++ b/compiler/GHC/Tc/Errors/Ppr.hs
@@ -1840,17 +1840,19 @@ instance Diagnostic TcRnMessage where
TcRnIllegalInferredTyVars _
-> mkSimpleDecorated $
text "Inferred type variables are not allowed"
- TcRnAmbiguousName name gres
+ TcRnAmbiguousName gre_env name gres
-> mkSimpleDecorated $
- vcat [ text "Ambiguous occurrence" <+> quotes (ppr name)
+ vcat [ text "Ambiguous occurrence" <+> quotes (ppr name) <> dot
, text "It could refer to"
- , nest 3 (vcat (msg1 : msgs)) ]
+ , nest 3 (vcat msgs) ]
where
np1 NE.:| nps = gres
- msg1 = text "either" <+> ppr_gre np1
- msgs = [text " or" <+> ppr_gre np | np <- nps]
- ppr_gre gre = sep [ pprAmbiguousGreName gre <> comma
- , pprNameProvenance gre]
+ msgs = punctuateFinal comma dot $
+ text "either" <+> ppr_gre np1
+ : [text " or" <+> ppr_gre np | np <- nps]
+
+ ppr_gre gre = pprAmbiguousGreName gre_env gre
+
TcRnBindingNameConflict name locs
-> mkSimpleDecorated $
vcat [text "Conflicting definitions for" <+> quotes (ppr name),
@@ -5439,17 +5441,44 @@ pprUnusedName name reason =
-- imported from ‘Prelude’ at T15487.hs:1:8-13
-- or ...
-- See #15487
-pprAmbiguousGreName :: GlobalRdrElt -> SDoc
-pprAmbiguousGreName gre
- | isRecFldGRE gre
- = text "the field" <+> quotes (ppr occ) <+> parent_info
+pprAmbiguousGreName :: GlobalRdrEnv -> GlobalRdrElt -> SDoc
+pprAmbiguousGreName gre_env gre
+ | IAmRecField fld_info <- gre_info gre
+ = sep [ text "the field" <+> quotes (ppr occ) <+> parent_info fld_info <> comma
+ , pprNameProvenance gre ]
| otherwise
- = quotes (pp_qual <> dot <> ppr occ)
+ = sep [ quotes (pp_qual <> dot <> ppr occ) <> comma
+ , pprNameProvenance gre ]
+
where
occ = greOccName gre
- parent_info = case gre_par gre of
- NoParent -> empty
- ParentIs { par_is = par_name } -> text "of record" <+> quotes (ppr par_name)
+ parent_info fld_info =
+ case first_con of
+ PatSynName ps -> text "of pattern synonym" <+> quotes (ppr ps)
+ DataConName {} ->
+ case gre_par gre of
+ ParentIs par
+ -- For a data family, only reporting the family TyCon can be
+ -- unhelpful (see T23301). So we give a bit of additional
+ -- info in that case.
+ | Just par_gre <- lookupGRE_Name gre_env par
+ , IAmTyCon tc_flav <- gre_info par_gre
+ , OpenFamilyFlavour IAmData _ <- tc_flav
+ -> vcat [ ppr_cons
+ , text "in a data family instance of" <+> quotes (ppr par) ]
+ | otherwise
+ -> text "of record" <+> quotes (ppr par)
+ NoParent -> ppr_cons
+ where
+ cons :: [ConLikeName]
+ cons = nonDetEltsUniqSet $ recFieldCons fld_info
+ first_con :: ConLikeName
+ first_con = head cons
+ ppr_cons :: SDoc
+ ppr_cons = hsep [ text "belonging to data constructor"
+ , quotes (ppr $ nameOccName $ conLikeName_Name first_con)
+ , if length cons > 1 then parens (text "among others") else empty
+ ]
pp_qual
| gre_lcl gre
= ppr (nameModule $ greName gre)
diff --git a/compiler/GHC/Tc/Errors/Types.hs b/compiler/GHC/Tc/Errors/Types.hs
index 4c2d29a0b5..cd80a3dbc9 100644
--- a/compiler/GHC/Tc/Errors/Types.hs
+++ b/compiler/GHC/Tc/Errors/Types.hs
@@ -4024,7 +4024,8 @@ data TcRnMessage where
T18999_NoDisambiguateRecordFields, T19397E1, T19397E2, T23010_fail,
tcfail037
-}
- TcRnAmbiguousName :: !RdrName -- ^ The name
+ TcRnAmbiguousName :: !GlobalRdrEnv
+ -> !RdrName -- ^ The name
-> !(NE.NonEmpty GlobalRdrElt) -- ^ The possible matches
-> TcRnMessage
diff --git a/compiler/GHC/Tc/Module.hs b/compiler/GHC/Tc/Module.hs
index 637baba3b6..b9153b6473 100644
--- a/compiler/GHC/Tc/Module.hs
+++ b/compiler/GHC/Tc/Module.hs
@@ -989,7 +989,8 @@ checkHiBootIface'
-- At least 2 matches: report an ambiguity error.
(gre1,_):(gre2,_):gres_ids -> do
addErrAt (nameSrcSpan missing_name) $
- mkNameClashErr (nameRdrName missing_name) (gre1 NE.:| gre2 : map fst gres_ids)
+ mkNameClashErr gre_env (nameRdrName missing_name)
+ (gre1 NE.:| gre2 : map fst gres_ids)
return Nothing
-- Single match: resolve the issue.
diff --git a/compiler/GHC/Utils/Outputable.hs b/compiler/GHC/Utils/Outputable.hs
index f63d515b83..49c0b10251 100644
--- a/compiler/GHC/Utils/Outputable.hs
+++ b/compiler/GHC/Utils/Outputable.hs
@@ -47,8 +47,8 @@ module GHC.Utils.Outputable (
blankLine, forAllLit, bullet,
($+$),
cat, fcat,
- hang, hangNotEmpty, punctuate, ppWhen, ppUnless,
- ppWhenOption, ppUnlessOption,
+ hang, hangNotEmpty, punctuate, punctuateFinal,
+ ppWhen, ppUnless, ppWhenOption, ppUnlessOption,
speakNth, speakN, speakNOf, plural, singular,
isOrAre, doOrDoes, itsOrTheir, thisOrThese, hasOrHave,
unicodeSyntax,
@@ -153,7 +153,7 @@ import Data.List (intersperse)
import Data.List.NonEmpty (NonEmpty (..))
import Data.Semigroup (Arg(..))
import qualified Data.List.NonEmpty as NEL
-import Data.Time
+import Data.Time ( UTCTime )
import Data.Time.Format.ISO8601
import Data.Void
@@ -842,6 +842,21 @@ punctuate p (d:ds) = go d ds
go d [] = [d]
go d (e:es) = (d <> p) : go e es
+-- | Punctuate a list, e.g. with commas and dots.
+--
+-- > sep $ punctuateFinal comma dot [text "ab", text "cd", text "ef"]
+-- > ab, cd, ef.
+punctuateFinal :: IsLine doc
+ => doc -- ^ The interstitial punctuation
+ -> doc -- ^ The final punctuation
+ -> [doc] -- ^ The list that will have punctuation added between every adjacent pair of elements
+ -> [doc] -- ^ Punctuated list
+punctuateFinal _ _ [] = []
+punctuateFinal p q (d:ds) = go d ds
+ where
+ go d [] = [d <> q]
+ go d (e:es) = (d <> p) : go e es
+
ppWhen, ppUnless :: IsOutput doc => Bool -> doc -> doc
{-# INLINE CONLIKE ppWhen #-}
ppWhen True doc = doc
diff --git a/testsuite/tests/module/mod110.stderr b/testsuite/tests/module/mod110.stderr
index 38e9c79a54..97f7eedadb 100644
--- a/testsuite/tests/module/mod110.stderr
+++ b/testsuite/tests/module/mod110.stderr
@@ -1,7 +1,8 @@
mod110.hs:11:10: error: [GHC-87543]
- Ambiguous occurrence ‘Eq’
- It could refer to either ‘Prelude.Eq’,
- imported from ‘Prelude’ at mod110.hs:4:1-14
- (and originally defined in ‘GHC.Classes’)
- or ‘M.Eq’, defined at mod110.hs:7:1
+ Ambiguous occurrence ‘Eq’.
+ It could refer to
+ either ‘Prelude.Eq’,
+ imported from ‘Prelude’ at mod110.hs:4:1-14
+ (and originally defined in ‘GHC.Classes’),
+ or ‘M.Eq’, defined at mod110.hs:7:1.
diff --git a/testsuite/tests/module/mod151.stderr b/testsuite/tests/module/mod151.stderr
index 8bb41459fb..ca382a3155 100644
--- a/testsuite/tests/module/mod151.stderr
+++ b/testsuite/tests/module/mod151.stderr
@@ -1,7 +1,8 @@
mod151.hs:2:20: error: [GHC-87543]
- Ambiguous occurrence ‘id’
- It could refer to either ‘Prelude.id’,
- imported from ‘Prelude’ at mod151.hs:2:8
- (and originally defined in ‘GHC.Base’)
- or ‘M.id’, defined at mod151.hs:2:30
+ Ambiguous occurrence ‘id’.
+ It could refer to
+ either ‘Prelude.id’,
+ imported from ‘Prelude’ at mod151.hs:2:8
+ (and originally defined in ‘GHC.Base’),
+ or ‘M.id’, defined at mod151.hs:2:30.
diff --git a/testsuite/tests/module/mod152.stderr b/testsuite/tests/module/mod152.stderr
index d60269b757..9742ed69ba 100644
--- a/testsuite/tests/module/mod152.stderr
+++ b/testsuite/tests/module/mod152.stderr
@@ -1,7 +1,8 @@
mod152.hs:2:26: error: [GHC-87543]
- Ambiguous occurrence ‘id’
- It could refer to either ‘Prelude.id’,
- imported from ‘Prelude’ at mod152.hs:2:8
- (and originally defined in ‘GHC.Base’)
- or ‘M.id’, defined at mod152.hs:2:36
+ Ambiguous occurrence ‘id’.
+ It could refer to
+ either ‘Prelude.id’,
+ imported from ‘Prelude’ at mod152.hs:2:8
+ (and originally defined in ‘GHC.Base’),
+ or ‘M.id’, defined at mod152.hs:2:36.
diff --git a/testsuite/tests/module/mod153.stderr b/testsuite/tests/module/mod153.stderr
index 989b27a77e..7d71dbcd0a 100644
--- a/testsuite/tests/module/mod153.stderr
+++ b/testsuite/tests/module/mod153.stderr
@@ -1,7 +1,8 @@
mod153.hs:2:11: error: [GHC-87543]
- Ambiguous occurrence ‘id’
- It could refer to either ‘Prelude.id’,
- imported from ‘Prelude’ at mod153.hs:2:8
- (and originally defined in ‘GHC.Base’)
- or ‘M.id’, defined at mod153.hs:2:21
+ Ambiguous occurrence ‘id’.
+ It could refer to
+ either ‘Prelude.id’,
+ imported from ‘Prelude’ at mod153.hs:2:8
+ (and originally defined in ‘GHC.Base’),
+ or ‘M.id’, defined at mod153.hs:2:21.
diff --git a/testsuite/tests/module/mod164.stderr b/testsuite/tests/module/mod164.stderr
index d6c0a9eec2..26de35564e 100644
--- a/testsuite/tests/module/mod164.stderr
+++ b/testsuite/tests/module/mod164.stderr
@@ -1,9 +1,10 @@
-mod164.hs:9:5: [GHC-87543]
- Ambiguous occurrence ‘D1’
- It could refer to either ‘Mod164_A.D1’,
- imported from ‘Mod164_A’ at mod164.hs:4:1-15
- (and originally defined at Mod164_A.hs:3:10-11)
- or ‘Mod164_B.D1’,
- imported from ‘Mod164_B’ at mod164.hs:5:1-15
- (and originally defined at Mod164_B.hs:3:10-11)
+mod164.hs:9:5: error: [GHC-87543]
+ Ambiguous occurrence ‘D1’.
+ It could refer to
+ either ‘Mod164_A.D1’,
+ imported from ‘Mod164_A’ at mod164.hs:4:1-15
+ (and originally defined at Mod164_A.hs:3:10-11),
+ or ‘Mod164_B.D1’,
+ imported from ‘Mod164_B’ at mod164.hs:5:1-15
+ (and originally defined at Mod164_B.hs:3:10-11).
diff --git a/testsuite/tests/module/mod165.stderr b/testsuite/tests/module/mod165.stderr
index 9ef57d4bbd..be092c086e 100644
--- a/testsuite/tests/module/mod165.stderr
+++ b/testsuite/tests/module/mod165.stderr
@@ -1,7 +1,7 @@
-mod165.hs:9:5: [GHC-87543]
- Ambiguous occurrence ‘A.D1’
- It could refer to either ‘A.D1’,
- imported from ‘Mod164_A’ at mod165.hs:4:1-20
- or ‘A.D1’, imported from ‘Mod164_B’ at mod165.hs:5:1-20
+mod165.hs:9:5: error: [GHC-87543]
+ Ambiguous occurrence ‘A.D1’.
+ It could refer to
+ either ‘A.D1’, imported from ‘Mod164_A’ at mod165.hs:4:1-20,
+ or ‘A.D1’, imported from ‘Mod164_B’ at mod165.hs:5:1-20.
exit(1)
diff --git a/testsuite/tests/overloadedrecflds/ghci/GHCiDRF.stdout b/testsuite/tests/overloadedrecflds/ghci/GHCiDRF.stdout
index 4d4e5817d9..f68331068f 100644
--- a/testsuite/tests/overloadedrecflds/ghci/GHCiDRF.stdout
+++ b/testsuite/tests/overloadedrecflds/ghci/GHCiDRF.stdout
@@ -1,10 +1,10 @@
GHCiDRF.foo :: T -> Int
<interactive>:1:1: error: [GHC-87543]
- Ambiguous occurrence ‘GHCiDRF.bar’
+ Ambiguous occurrence ‘GHCiDRF.bar’.
It could refer to
- either the field ‘bar’ of record ‘T’, defined at GHCiDRF.hs:3:28
- or the field ‘bar’ of record ‘U’, defined at GHCiDRF.hs:4:16
+ either the field ‘bar’ of record ‘T’, defined at GHCiDRF.hs:3:28,
+ or the field ‘bar’ of record ‘U’, defined at GHCiDRF.hs:4:16.
type T :: *
data T = MkT {foo :: Int, ...}
-- Defined at GHCiDRF.hs:3:16
@@ -18,14 +18,14 @@ data U = MkU {bar :: Bool}
GHCiDRF.foo :: GHCiDRF.T -> Int
<interactive>:1:1: error: [GHC-87543]
- Ambiguous occurrence ‘GHCiDRF.bar’
+ Ambiguous occurrence ‘GHCiDRF.bar’.
It could refer to
- either the field ‘bar’,
+ either the field ‘bar’ belonging to data constructor ‘MkT’,
imported qualified from ‘GHCiDRF’
- (and originally defined at GHCiDRF.hs:3:28-30)
- or the field ‘bar’,
+ (and originally defined at GHCiDRF.hs:3:28-30),
+ or the field ‘bar’ belonging to data constructor ‘MkU’,
imported qualified from ‘GHCiDRF’
- (and originally defined at GHCiDRF.hs:4:16-18)
+ (and originally defined at GHCiDRF.hs:4:16-18).
type GHCiDRF.T :: *
data GHCiDRF.T = GHCiDRF.MkT {GHCiDRF.foo :: Int, ...}
-- Defined at GHCiDRF.hs:3:16
@@ -38,11 +38,11 @@ data GHCiDRF.U = GHCiDRF.MkU {GHCiDRF.bar :: Bool}
-- Defined at GHCiDRF.hs:4:16
<interactive>:11:1: error: [GHC-87543]
- Ambiguous occurrence ‘GHCiDRF.bar’
+ Ambiguous occurrence ‘GHCiDRF.bar’.
It could refer to
- either the field ‘bar’,
+ either the field ‘bar’ belonging to data constructor ‘MkT’,
imported qualified from ‘GHCiDRF’
- (and originally defined at GHCiDRF.hs:3:28-30)
- or the field ‘bar’,
+ (and originally defined at GHCiDRF.hs:3:28-30),
+ or the field ‘bar’ belonging to data constructor ‘MkU’,
imported qualified from ‘GHCiDRF’
- (and originally defined at GHCiDRF.hs:4:16-18)
+ (and originally defined at GHCiDRF.hs:4:16-18).
diff --git a/testsuite/tests/overloadedrecflds/ghci/duplicaterecfldsghci01.stdout b/testsuite/tests/overloadedrecflds/ghci/duplicaterecfldsghci01.stdout
index c1bb4c99f0..c13d87bb8e 100644
--- a/testsuite/tests/overloadedrecflds/ghci/duplicaterecfldsghci01.stdout
+++ b/testsuite/tests/overloadedrecflds/ghci/duplicaterecfldsghci01.stdout
@@ -9,10 +9,12 @@ data T a = MkT {foo :: Bool, ...}
True
<interactive>:1:1: error: [GHC-87543]
- Ambiguous occurrence ‘foo’
+ Ambiguous occurrence ‘foo’.
It could refer to
- either the field ‘foo’ of record ‘S’, defined at <interactive>:3:16
- or the field ‘foo’ of record ‘T’, defined at <interactive>:4:18
+ either the field ‘foo’ of record ‘S’,
+ defined at <interactive>:3:16,
+ or the field ‘foo’ of record ‘T’,
+ defined at <interactive>:4:18.
type U :: *
data U = MkU {foo :: Int}
-- Defined at <interactive>:12:16
diff --git a/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport.stderr b/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport.stderr
index 29d8f451ca..b284812ce2 100644
--- a/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport.stderr
+++ b/testsuite/tests/overloadedrecflds/should_compile/BootFldReexport.stderr
@@ -1,11 +1,11 @@
BootFldReexport.hs:8:9: error: [GHC-87543]
- Ambiguous occurrence ‘fld’
+ Ambiguous occurrence ‘fld’.
It could refer to
either ‘BootFldReexport_N.fld’,
imported from ‘BootFldReexport_N’ at BootFldReexport.hs:4:5-7
(and originally defined in ‘BootFldReexport_O’
- at BootFldReexport_O.hs-boot:4:1-13)
+ at BootFldReexport_O.hs-boot:4:1-13),
or the field ‘fld’ of record ‘BootFldReexport_O.O’,
imported from ‘BootFldReexport_O’ at BootFldReexport.hs:6:5-7
- (and originally defined at BootFldReexport_O.hs:5:16-18)
+ (and originally defined at BootFldReexport_O.hs:5:16-18).
diff --git a/testsuite/tests/overloadedrecflds/should_fail/DRFUnused.stderr b/testsuite/tests/overloadedrecflds/should_fail/DRFUnused.stderr
index 81029d6cd3..026a8b0c56 100644
--- a/testsuite/tests/overloadedrecflds/should_fail/DRFUnused.stderr
+++ b/testsuite/tests/overloadedrecflds/should_fail/DRFUnused.stderr
@@ -1,7 +1,10 @@
DRFUnused.hs:18:5: error: [GHC-87543]
- Ambiguous occurrence ‘foo’
+ Ambiguous occurrence ‘foo’.
It could refer to
- either the field ‘foo’ of record ‘S’, defined at DRFUnused.hs:10:16
- or the field ‘foo’ of record ‘T’, defined at DRFUnused.hs:11:16
- or the field ‘foo’ of record ‘U’, defined at DRFUnused.hs:12:16
+ either the field ‘foo’ of record ‘S’,
+ defined at DRFUnused.hs:10:16,
+ or the field ‘foo’ of record ‘T’,
+ defined at DRFUnused.hs:11:16,
+ or the field ‘foo’ of record ‘U’,
+ defined at DRFUnused.hs:12:16.
diff --git a/testsuite/tests/overloadedrecflds/should_fail/NoFieldSelectorsFail.stderr b/testsuite/tests/overloadedrecflds/should_fail/NoFieldSelectorsFail.stderr
index 4eb98f3778..cf92d760c2 100644
--- a/testsuite/tests/overloadedrecflds/should_fail/NoFieldSelectorsFail.stderr
+++ b/testsuite/tests/overloadedrecflds/should_fail/NoFieldSelectorsFail.stderr
@@ -1,13 +1,13 @@
NoFieldSelectorsFail.hs:9:14: error: [GHC-87543]
- Ambiguous occurrence ‘foo’
+ Ambiguous occurrence ‘foo’.
It could refer to
either the field ‘foo’ of record ‘Foo’,
imported from ‘NoFieldSelectorsFailA’ at NoFieldSelectorsFail.hs:4:1-28
- (and originally defined at NoFieldSelectorsFailA.hs:5:18-20)
+ (and originally defined at NoFieldSelectorsFailA.hs:5:18-20),
or the field ‘foo’ of record ‘Bar’,
imported from ‘NoFieldSelectorsFailA’ at NoFieldSelectorsFail.hs:4:1-28
- (and originally defined at NoFieldSelectorsFailA.hs:6:18-20)
+ (and originally defined at NoFieldSelectorsFailA.hs:6:18-20).
NoFieldSelectorsFail.hs:12:15: error: [GHC-56428]
Ambiguous record field ‘foo’.
diff --git a/testsuite/tests/overloadedrecflds/should_fail/T11167_ambiguous_fixity.stderr b/testsuite/tests/overloadedrecflds/should_fail/T11167_ambiguous_fixity.stderr
index 8a1691ac22..d05c8e76fe 100644
--- a/testsuite/tests/overloadedrecflds/should_fail/T11167_ambiguous_fixity.stderr
+++ b/testsuite/tests/overloadedrecflds/should_fail/T11167_ambiguous_fixity.stderr
@@ -3,14 +3,14 @@
[3 of 3] Compiling T11167_ambiguous_fixity ( T11167_ambiguous_fixity.hs, T11167_ambiguous_fixity.o )
T11167_ambiguous_fixity.hs:6:16: error: [GHC-87543]
- Ambiguous occurrence ‘foo’
+ Ambiguous occurrence ‘foo’.
It could refer to
either the field ‘foo’ of record ‘A’,
imported from ‘T11167_ambiguous_fixity_A’ at T11167_ambiguous_fixity.hs:3:1-32
- (and originally defined at T11167_ambiguous_fixity_A.hs:3:16-18)
+ (and originally defined at T11167_ambiguous_fixity_A.hs:3:16-18),
or the field ‘foo’ of record ‘C’,
imported from ‘T11167_ambiguous_fixity_A’ at T11167_ambiguous_fixity.hs:3:1-32
- (and originally defined at T11167_ambiguous_fixity_A.hs:4:16-18)
+ (and originally defined at T11167_ambiguous_fixity_A.hs:4:16-18),
or the field ‘foo’ of record ‘B’,
imported from ‘T11167_ambiguous_fixity_B’ at T11167_ambiguous_fixity.hs:4:1-32
- (and originally defined at T11167_ambiguous_fixity_B.hs:2:16-18)
+ (and originally defined at T11167_ambiguous_fixity_B.hs:2:16-18).
diff --git a/testsuite/tests/overloadedrecflds/should_fail/T13132_duplicaterecflds.stderr b/testsuite/tests/overloadedrecflds/should_fail/T13132_duplicaterecflds.stderr
index 00fbe0899b..576e6d41f6 100644
--- a/testsuite/tests/overloadedrecflds/should_fail/T13132_duplicaterecflds.stderr
+++ b/testsuite/tests/overloadedrecflds/should_fail/T13132_duplicaterecflds.stderr
@@ -1,11 +1,11 @@
T13132_duplicaterecflds.hs:7:16: error: [GHC-87543]
- Ambiguous occurrence ‘runContT’
+ Ambiguous occurrence ‘runContT’.
It could refer to
either the field ‘runContT’ of record ‘ContT’,
- defined at T13132_duplicaterecflds.hs:4:31
+ defined at T13132_duplicaterecflds.hs:4:31,
or the field ‘runContT’ of record ‘ContT2’,
- defined at T13132_duplicaterecflds.hs:5:33
+ defined at T13132_duplicaterecflds.hs:5:33.
T13132_duplicaterecflds.hs:9:11: error: [GHC-46878]
The operator ‘runContT’ [infixl 9] of a section
@@ -14,9 +14,9 @@ T13132_duplicaterecflds.hs:9:11: error: [GHC-46878]
in the section: ‘`runContT` x `y` x’
T13132_duplicaterecflds.hs:9:12: error: [GHC-87543]
- Ambiguous occurrence ‘runContT’
+ Ambiguous occurrence ‘runContT’.
It could refer to
either the field ‘runContT’ of record ‘ContT’,
- defined at T13132_duplicaterecflds.hs:4:31
+ defined at T13132_duplicaterecflds.hs:4:31,
or the field ‘runContT’ of record ‘ContT2’,
- defined at T13132_duplicaterecflds.hs:5:33
+ defined at T13132_duplicaterecflds.hs:5:33.
diff --git a/testsuite/tests/overloadedrecflds/should_fail/T16745.stderr b/testsuite/tests/overloadedrecflds/should_fail/T16745.stderr
index b4515b8a19..ebc974a123 100644
--- a/testsuite/tests/overloadedrecflds/should_fail/T16745.stderr
+++ b/testsuite/tests/overloadedrecflds/should_fail/T16745.stderr
@@ -4,11 +4,11 @@
[4 of 4] Compiling T16745A ( T16745A.hs, T16745A.o )
T16745A.hs:8:9: error: [GHC-87543]
- Ambiguous occurrence ‘field’
+ Ambiguous occurrence ‘field’.
It could refer to
either ‘T16745B.field’,
imported from ‘T16745B’ at T16745A.hs:3:24-28
- (and originally defined in ‘T16745C’ at T16745C.hs:2:1-5)
+ (and originally defined in ‘T16745C’ at T16745C.hs:2:1-5),
or the field ‘field’ of record ‘T16745B.R’,
imported from ‘T16745B’ at T16745A.hs:3:24-28
- (and originally defined at T16745B.hs:11:14-18)
+ (and originally defined at T16745B.hs:11:14-18).
diff --git a/testsuite/tests/overloadedrecflds/should_fail/T17420.stderr b/testsuite/tests/overloadedrecflds/should_fail/T17420.stderr
index 3a94cd5639..3079d44aba 100644
--- a/testsuite/tests/overloadedrecflds/should_fail/T17420.stderr
+++ b/testsuite/tests/overloadedrecflds/should_fail/T17420.stderr
@@ -2,11 +2,11 @@
[2 of 2] Compiling T17420 ( T17420.hs, T17420.o )
T17420.hs:6:17: error: [GHC-87543]
- Ambiguous occurrence ‘name’
+ Ambiguous occurrence ‘name’.
It could refer to
either the field ‘name’ of record ‘Dog’,
imported from ‘T17420A’ at T17420.hs:4:1-14
- (and originally defined at T17420A.hs:4:18-21)
+ (and originally defined at T17420A.hs:4:18-21),
or the field ‘name’ of record ‘Human’,
imported from ‘T17420A’ at T17420.hs:4:1-14
- (and originally defined at T17420A.hs:5:22-25)
+ (and originally defined at T17420A.hs:5:22-25).
diff --git a/testsuite/tests/overloadedrecflds/should_fail/T18999_NoDisambiguateRecordFields.stderr b/testsuite/tests/overloadedrecflds/should_fail/T18999_NoDisambiguateRecordFields.stderr
index 7e7939e028..a54338cbf0 100644
--- a/testsuite/tests/overloadedrecflds/should_fail/T18999_NoDisambiguateRecordFields.stderr
+++ b/testsuite/tests/overloadedrecflds/should_fail/T18999_NoDisambiguateRecordFields.stderr
@@ -1,12 +1,12 @@
T18999_NoDisambiguateRecordFields.hs:6:13: error: [GHC-87543]
- Ambiguous occurrence ‘not’
+ Ambiguous occurrence ‘not’.
It could refer to
either ‘Prelude.not’,
imported from ‘Prelude’ at T18999_NoDisambiguateRecordFields.hs:2:8-40
- (and originally defined in ‘GHC.Classes’)
+ (and originally defined in ‘GHC.Classes’),
or the field ‘not’ of record ‘Foo’,
- defined at T18999_NoDisambiguateRecordFields.hs:4:18
+ defined at T18999_NoDisambiguateRecordFields.hs:4:18.
T18999_NoDisambiguateRecordFields.hs:8:11: error: [GHC-56428]
Ambiguous record field ‘not’.
diff --git a/testsuite/tests/overloadedrecflds/should_fail/T23010_fail.stderr b/testsuite/tests/overloadedrecflds/should_fail/T23010_fail.stderr
index 6a1b76dae9..6b31785f07 100644
--- a/testsuite/tests/overloadedrecflds/should_fail/T23010_fail.stderr
+++ b/testsuite/tests/overloadedrecflds/should_fail/T23010_fail.stderr
@@ -1,8 +1,8 @@
T23010_fail.hs-boot:7:1: error: [GHC-87543]
- Ambiguous occurrence ‘T23010_fail.fld’
+ Ambiguous occurrence ‘T23010_fail.fld’.
It could refer to
either the field ‘fld’ of record ‘A’,
- defined at T23010_fail.hs:6:16
+ defined at T23010_fail.hs:6:16,
or the field ‘fld’ of record ‘B’,
- defined at T23010_fail.hs:7:16
+ defined at T23010_fail.hs:7:16.
diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail02.stderr b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail02.stderr
index aaf57bd710..932f99ad32 100644
--- a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail02.stderr
+++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail02.stderr
@@ -1,8 +1,8 @@
overloadedrecfldsfail02.hs:8:18: error: [GHC-87543]
- Ambiguous occurrence ‘x’
+ Ambiguous occurrence ‘x’.
It could refer to
either the field ‘x’ of record ‘R’,
- defined at overloadedrecfldsfail02.hs:5:16
+ defined at overloadedrecfldsfail02.hs:5:16,
or the field ‘x’ of record ‘S’,
- defined at overloadedrecfldsfail02.hs:6:16
+ defined at overloadedrecfldsfail02.hs:6:16.
diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail04.stderr b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail04.stderr
index d319ae53f6..91ddc1721b 100644
--- a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail04.stderr
+++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail04.stderr
@@ -2,11 +2,11 @@
[2 of 3] Compiling Main ( overloadedrecfldsfail04.hs, overloadedrecfldsfail04.o )
overloadedrecfldsfail04.hs:9:6: error: [GHC-87543]
- Ambiguous occurrence ‘I.x’
+ Ambiguous occurrence ‘I.x’.
It could refer to
either the field ‘x’ of record ‘V’,
imported from ‘OverloadedRecFldsFail04_A’ at overloadedrecfldsfail04.hs:6:1-37
- (and originally defined at OverloadedRecFldsFail04_A.hs:6:16)
+ (and originally defined at OverloadedRecFldsFail04_A.hs:6:16),
or the field ‘x’ of record ‘U’,
imported from ‘OverloadedRecFldsFail04_A’ at overloadedrecfldsfail04.hs:6:1-37
- (and originally defined at OverloadedRecFldsFail04_A.hs:5:16)
+ (and originally defined at OverloadedRecFldsFail04_A.hs:5:16).
diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail11.stderr b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail11.stderr
index 423472841c..02316fbe92 100644
--- a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail11.stderr
+++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail11.stderr
@@ -2,11 +2,11 @@
[2 of 3] Compiling Main ( overloadedrecfldsfail11.hs, overloadedrecfldsfail11.o )
overloadedrecfldsfail11.hs:5:15: error: [GHC-87543]
- Ambiguous occurrence ‘foo’
+ Ambiguous occurrence ‘foo’.
It could refer to
either the field ‘foo’ of record ‘S’,
imported from ‘OverloadedRecFldsFail11_A’ at overloadedrecfldsfail11.hs:3:1-32
- (and originally defined at OverloadedRecFldsFail11_A.hs:5:16-18)
+ (and originally defined at OverloadedRecFldsFail11_A.hs:5:16-18),
or the field ‘foo’ of record ‘T’,
imported from ‘OverloadedRecFldsFail11_A’ at overloadedrecfldsfail11.hs:3:1-32
- (and originally defined at OverloadedRecFldsFail11_A.hs:6:16-18)
+ (and originally defined at OverloadedRecFldsFail11_A.hs:6:16-18).
diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail12.stderr b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail12.stderr
index a6abb29b19..92bf5a8217 100644
--- a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail12.stderr
+++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail12.stderr
@@ -2,19 +2,19 @@
[2 of 3] Compiling Main ( overloadedrecfldsfail12.hs, overloadedrecfldsfail12.o )
overloadedrecfldsfail12.hs:13:5: error: [GHC-87543]
- Ambiguous occurrence ‘foo’
+ Ambiguous occurrence ‘foo’.
It could refer to
either the field ‘foo’ of record ‘T’,
imported from ‘OverloadedRecFldsFail12_A’ at overloadedrecfldsfail12.hs:4:1-32
- (and originally defined at OverloadedRecFldsFail12_A.hs:5:16-18)
+ (and originally defined at OverloadedRecFldsFail12_A.hs:5:16-18),
or the field ‘foo’ of record ‘S’,
- defined at overloadedrecfldsfail12.hs:6:16
+ defined at overloadedrecfldsfail12.hs:6:16.
overloadedrecfldsfail12.hs:16:5: error: [GHC-87543]
- Ambiguous occurrence ‘foo’
+ Ambiguous occurrence ‘foo’.
It could refer to
either the field ‘foo’ of record ‘T’,
imported from ‘OverloadedRecFldsFail12_A’ at overloadedrecfldsfail12.hs:4:1-32
- (and originally defined at OverloadedRecFldsFail12_A.hs:5:16-18)
+ (and originally defined at OverloadedRecFldsFail12_A.hs:5:16-18),
or the field ‘foo’ of record ‘S’,
- defined at overloadedrecfldsfail12.hs:6:16
+ defined at overloadedrecfldsfail12.hs:6:16.
diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail13.stderr b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail13.stderr
index cf9a7a5678..89cc10f4f6 100644
--- a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail13.stderr
+++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail13.stderr
@@ -1,32 +1,32 @@
overloadedrecfldsfail13.hs:10:5: error: [GHC-87543]
- Ambiguous occurrence ‘x’
+ Ambiguous occurrence ‘x’.
It could refer to
either the field ‘x’ of record ‘S’,
- defined at overloadedrecfldsfail13.hs:6:16
+ defined at overloadedrecfldsfail13.hs:6:16,
or the field ‘x’ of record ‘T’,
- defined at overloadedrecfldsfail13.hs:7:16
+ defined at overloadedrecfldsfail13.hs:7:16.
overloadedrecfldsfail13.hs:12:5: error: [GHC-87543]
- Ambiguous occurrence ‘x’
+ Ambiguous occurrence ‘x’.
It could refer to
either the field ‘x’ of record ‘S’,
- defined at overloadedrecfldsfail13.hs:6:16
+ defined at overloadedrecfldsfail13.hs:6:16,
or the field ‘x’ of record ‘T’,
- defined at overloadedrecfldsfail13.hs:7:16
+ defined at overloadedrecfldsfail13.hs:7:16.
overloadedrecfldsfail13.hs:15:5: error: [GHC-87543]
- Ambiguous occurrence ‘x’
+ Ambiguous occurrence ‘x’.
It could refer to
either the field ‘x’ of record ‘S’,
- defined at overloadedrecfldsfail13.hs:6:16
+ defined at overloadedrecfldsfail13.hs:6:16,
or the field ‘x’ of record ‘T’,
- defined at overloadedrecfldsfail13.hs:7:16
+ defined at overloadedrecfldsfail13.hs:7:16.
overloadedrecfldsfail13.hs:18:5: error: [GHC-87543]
- Ambiguous occurrence ‘x’
+ Ambiguous occurrence ‘x’.
It could refer to
either the field ‘x’ of record ‘S’,
- defined at overloadedrecfldsfail13.hs:6:16
+ defined at overloadedrecfldsfail13.hs:6:16,
or the field ‘x’ of record ‘T’,
- defined at overloadedrecfldsfail13.hs:7:16
+ defined at overloadedrecfldsfail13.hs:7:16.
diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldswasrunnowfail06.stderr b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldswasrunnowfail06.stderr
index 2b90b16f97..f658bb1223 100644
--- a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldswasrunnowfail06.stderr
+++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldswasrunnowfail06.stderr
@@ -1,40 +1,40 @@
overloadedrecfldswasrunnowfail06.hs:11:11: error: [GHC-87543]
- Ambiguous occurrence ‘x’
+ Ambiguous occurrence ‘x’.
It could refer to
either the field ‘x’ of record ‘S’,
- defined at overloadedrecfldswasrunnowfail06.hs:6:16
+ defined at overloadedrecfldswasrunnowfail06.hs:6:16,
or the field ‘x’ of record ‘T’,
- defined at overloadedrecfldswasrunnowfail06.hs:7:16
+ defined at overloadedrecfldswasrunnowfail06.hs:7:16,
or the field ‘x’ of record ‘U’,
- defined at overloadedrecfldswasrunnowfail06.hs:8:18
+ defined at overloadedrecfldswasrunnowfail06.hs:8:18.
overloadedrecfldswasrunnowfail06.hs:13:11: error: [GHC-87543]
- Ambiguous occurrence ‘x’
+ Ambiguous occurrence ‘x’.
It could refer to
either the field ‘x’ of record ‘S’,
- defined at overloadedrecfldswasrunnowfail06.hs:6:16
+ defined at overloadedrecfldswasrunnowfail06.hs:6:16,
or the field ‘x’ of record ‘T’,
- defined at overloadedrecfldswasrunnowfail06.hs:7:16
+ defined at overloadedrecfldswasrunnowfail06.hs:7:16,
or the field ‘x’ of record ‘U’,
- defined at overloadedrecfldswasrunnowfail06.hs:8:18
+ defined at overloadedrecfldswasrunnowfail06.hs:8:18.
overloadedrecfldswasrunnowfail06.hs:15:13: error: [GHC-87543]
- Ambiguous occurrence ‘x’
+ Ambiguous occurrence ‘x’.
It could refer to
either the field ‘x’ of record ‘S’,
- defined at overloadedrecfldswasrunnowfail06.hs:6:16
+ defined at overloadedrecfldswasrunnowfail06.hs:6:16,
or the field ‘x’ of record ‘T’,
- defined at overloadedrecfldswasrunnowfail06.hs:7:16
+ defined at overloadedrecfldswasrunnowfail06.hs:7:16,
or the field ‘x’ of record ‘U’,
- defined at overloadedrecfldswasrunnowfail06.hs:8:18
+ defined at overloadedrecfldswasrunnowfail06.hs:8:18.
overloadedrecfldswasrunnowfail06.hs:21:20: error: [GHC-87543]
- Ambiguous occurrence ‘x’
+ Ambiguous occurrence ‘x’.
It could refer to
either the field ‘x’ of record ‘S’,
- defined at overloadedrecfldswasrunnowfail06.hs:6:16
+ defined at overloadedrecfldswasrunnowfail06.hs:6:16,
or the field ‘x’ of record ‘T’,
- defined at overloadedrecfldswasrunnowfail06.hs:7:16
+ defined at overloadedrecfldswasrunnowfail06.hs:7:16,
or the field ‘x’ of record ‘U’,
- defined at overloadedrecfldswasrunnowfail06.hs:8:18
+ defined at overloadedrecfldswasrunnowfail06.hs:8:18.
diff --git a/testsuite/tests/rename/should_fail/T11167_ambig.stderr b/testsuite/tests/rename/should_fail/T11167_ambig.stderr
index f23a644772..e4f552b3b9 100644
--- a/testsuite/tests/rename/should_fail/T11167_ambig.stderr
+++ b/testsuite/tests/rename/should_fail/T11167_ambig.stderr
@@ -1,16 +1,16 @@
T11167_ambig.hs:10:13: error: [GHC-87543]
- Ambiguous occurrence ‘runContT’
+ Ambiguous occurrence ‘runContT’.
It could refer to
either the field ‘runContT’ of record ‘ContT’,
- defined at T11167_ambig.hs:6:30
+ defined at T11167_ambig.hs:6:30,
or the field ‘runContT’ of record ‘ContT'’,
- defined at T11167_ambig.hs:7:32
+ defined at T11167_ambig.hs:7:32.
T11167_ambig.hs:17:9: error: [GHC-87543]
- Ambiguous occurrence ‘runContT’
+ Ambiguous occurrence ‘runContT’.
It could refer to
either the field ‘runContT’ of record ‘ContT’,
- defined at T11167_ambig.hs:6:30
+ defined at T11167_ambig.hs:6:30,
or the field ‘runContT’ of record ‘ContT'’,
- defined at T11167_ambig.hs:7:32
+ defined at T11167_ambig.hs:7:32.
diff --git a/testsuite/tests/rename/should_fail/T15487.stderr b/testsuite/tests/rename/should_fail/T15487.stderr
index a02cbe40c2..63b2101d1f 100644
--- a/testsuite/tests/rename/should_fail/T15487.stderr
+++ b/testsuite/tests/rename/should_fail/T15487.stderr
@@ -1,8 +1,8 @@
T15487.hs:7:9: error: [GHC-87543]
- Ambiguous occurrence ‘null’
+ Ambiguous occurrence ‘null’.
It could refer to
either ‘Prelude.null’,
imported from ‘Prelude’ at T15487.hs:1:8-13
- (and originally defined in ‘Data.Foldable’)
- or ‘T15487.null’, defined at T15487.hs:5:1
+ (and originally defined in ‘Data.Foldable’),
+ or ‘T15487.null’, defined at T15487.hs:5:1.
diff --git a/testsuite/tests/rename/should_fail/T23301.hs b/testsuite/tests/rename/should_fail/T23301.hs
new file mode 100644
index 0000000000..e487d34324
--- /dev/null
+++ b/testsuite/tests/rename/should_fail/T23301.hs
@@ -0,0 +1,9 @@
+{-# LANGUAGE DuplicateRecordFields, TypeFamilies #-}
+
+module T23301 where
+
+data family D a
+data instance D Int = MkD1 { fld :: Int } | MkD1b | MkD1c { fld :: Int, bar :: Bool }
+data instance D Bool = MkD2 { fld :: Bool }
+
+foo = fld
diff --git a/testsuite/tests/rename/should_fail/T23301.stderr b/testsuite/tests/rename/should_fail/T23301.stderr
new file mode 100644
index 0000000000..ac6f2479d9
--- /dev/null
+++ b/testsuite/tests/rename/should_fail/T23301.stderr
@@ -0,0 +1,10 @@
+
+T23301.hs:9:7: [GHC-87543]
+ Ambiguous occurrence ‘fld’.
+ It could refer to
+ either the field ‘fld’ belonging to data constructor ‘MkD1’ (among others)
+ in a data family instance of ‘D’,
+ defined at T23301.hs:6:31,
+ or the field ‘fld’ belonging to data constructor ‘MkD2’
+ in a data family instance of ‘D’,
+ defined at T23301.hs:7:31.
diff --git a/testsuite/tests/rename/should_fail/all.T b/testsuite/tests/rename/should_fail/all.T
index 7ea8d6fd3a..883476aac5 100644
--- a/testsuite/tests/rename/should_fail/all.T
+++ b/testsuite/tests/rename/should_fail/all.T
@@ -188,6 +188,7 @@ test('T21605b', normal, compile_fail, [''])
test('T21605c', normal, compile_fail, [''])
test('T21605d', normal, compile_fail, [''])
test('T22839', normal, compile_fail, [''])
+test('T23301', normal, compile_fail, [''])
test('RnPatternSynonymFail', [js_broken(22261), req_th], compile_fail, [''])
test('RnMultipleFixityFail', normal, compile_fail, [''])
test('RnEmptyCaseFail', normal, compile_fail, [''])
diff --git a/testsuite/tests/rename/should_fail/rnfail044.stderr b/testsuite/tests/rename/should_fail/rnfail044.stderr
index 795cee0dfa..8c25ec2cda 100644
--- a/testsuite/tests/rename/should_fail/rnfail044.stderr
+++ b/testsuite/tests/rename/should_fail/rnfail044.stderr
@@ -1,8 +1,8 @@
rnfail044.hs:5:12: error: [GHC-87543]
- Ambiguous occurrence ‘splitAt’
+ Ambiguous occurrence ‘splitAt’.
It could refer to
either ‘Prelude.splitAt’,
imported from ‘Prelude’ at rnfail044.hs:5:8
- (and originally defined in ‘GHC.List’)
- or ‘A.splitAt’, defined at rnfail044.hs:8:3
+ (and originally defined in ‘GHC.List’),
+ or ‘A.splitAt’, defined at rnfail044.hs:8:3.
diff --git a/testsuite/tests/typecheck/should_fail/T19397E1.stderr b/testsuite/tests/typecheck/should_fail/T19397E1.stderr
index 066b8f1da4..6e614caebc 100644
--- a/testsuite/tests/typecheck/should_fail/T19397E1.stderr
+++ b/testsuite/tests/typecheck/should_fail/T19397E1.stderr
@@ -1,8 +1,8 @@
T19397E1.hs:1:14: error: [GHC-87543]
- Ambiguous occurrence ‘main’
+ Ambiguous occurrence ‘main’.
It could refer to
either ‘T19397S.main’,
imported from ‘T19397S’ at T19397E1.hs:2:1-14
- (and originally defined at T19397S.hs:4:1-4)
- or ‘Main.main’, defined at T19397E1.hs:5:1
+ (and originally defined at T19397S.hs:4:1-4),
+ or ‘Main.main’, defined at T19397E1.hs:5:1.
diff --git a/testsuite/tests/typecheck/should_fail/T19397E2.stderr b/testsuite/tests/typecheck/should_fail/T19397E2.stderr
index a66e6170ca..ec444f8f65 100644
--- a/testsuite/tests/typecheck/should_fail/T19397E2.stderr
+++ b/testsuite/tests/typecheck/should_fail/T19397E2.stderr
@@ -1,8 +1,8 @@
T19397E2.hs:1:1: error: [GHC-87543]
- Ambiguous occurrence ‘main’
+ Ambiguous occurrence ‘main’.
It could refer to
either ‘T19397S.main’,
imported from ‘T19397S’ at T19397E2.hs:2:1-14
- (and originally defined at T19397S.hs:4:1-4)
- or ‘Main.main’, defined at T19397E2.hs:5:1
+ (and originally defined at T19397S.hs:4:1-4),
+ or ‘Main.main’, defined at T19397E2.hs:5:1.
diff --git a/testsuite/tests/typecheck/should_fail/tcfail037.stderr b/testsuite/tests/typecheck/should_fail/tcfail037.stderr
index 60432d8626..f0b809c6af 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail037.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail037.stderr
@@ -1,7 +1,8 @@
tcfail037.hs:7:11: error: [GHC-87543]
- Ambiguous occurrence ‘+’
- It could refer to either ‘Prelude.+’,
- imported from ‘Prelude’ at tcfail037.hs:3:8-17
- (and originally defined in ‘GHC.Num’)
- or ‘ShouldFail.+’, defined at tcfail037.hs:10:5
+ Ambiguous occurrence ‘+’.
+ It could refer to
+ either ‘Prelude.+’,
+ imported from ‘Prelude’ at tcfail037.hs:3:8-17
+ (and originally defined in ‘GHC.Num’),
+ or ‘ShouldFail.+’, defined at tcfail037.hs:10:5.