From 350e2b78788d47255d27489dfc62d664498b5de4 Mon Sep 17 00:00:00 2001 From: Richard Eisenberg Date: Wed, 11 Dec 2019 15:58:56 +0000 Subject: Don't zap to Any; error instead This changes GHC's treatment of so-called Naughty Quantification Candidates to issue errors, instead of zapping to Any. Close #16775. No new test cases, because existing ones cover this well. --- compiler/utils/Outputable.hs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'compiler/utils/Outputable.hs') diff --git a/compiler/utils/Outputable.hs b/compiler/utils/Outputable.hs index d81c754866..02805c6c7c 100644 --- a/compiler/utils/Outputable.hs +++ b/compiler/utils/Outputable.hs @@ -34,7 +34,7 @@ module Outputable ( sep, cat, fsep, fcat, hang, hangNotEmpty, punctuate, ppWhen, ppUnless, - speakNth, speakN, speakNOf, plural, isOrAre, doOrDoes, + speakNth, speakN, speakNOf, plural, isOrAre, doOrDoes, itsOrTheir, unicodeSyntax, coloured, keyword, @@ -1160,6 +1160,15 @@ doOrDoes :: [a] -> SDoc doOrDoes [_] = text "does" doOrDoes _ = text "do" +-- | Determines the form of possessive appropriate for the length of a list: +-- +-- > itsOrTheir [x] = text "its" +-- > itsOrTheir [x,y] = text "their" +-- > itsOrTheir [] = text "their" -- probably avoid this +itsOrTheir :: [a] -> SDoc +itsOrTheir [_] = text "its" +itsOrTheir _ = text "their" + {- ************************************************************************ * * -- cgit v1.2.1