Skip to content

Commit 5072490

Browse files
committed
Make sure hints about removing extensions match what you called it - otherwise you get RecordPuns instead of NamedFieldPuns
1 parent f7be4b7 commit 5072490

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Changelog for HLint (* = breaking change)
22

3+
Make sure the extension removed matches what you called it
34
* #1124, make test into a flag rather than a mode, use --test
45
#1073, add LHS/RHS hints to the summary
56
* Remove test --proof, --quickcheck and --typecheck, --tempdir

src/Hint/Extensions.hs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ import Data.Foldable -- @NoRefactor: refactor only works when using GHC 8.10
226226
{-# LANGUAGE StandaloneKindSignatures #-} \
227227
type T :: (k -> Type) -> k -> Type \
228228
data T m a = MkT (m a) (T Maybe (m a))
229+
{-# LANGUAGE NoMonomorphismRestriction, NamedFieldPuns #-} \
230+
main = 1 -- @Note Extension NamedFieldPuns is not used
229231
</TEST>
230232
-}
231233

@@ -271,8 +273,8 @@ extensionsHint _ x =
271273
(comment (mkLanguagePragmas sl exts))
272274
(Just newPragma)
273275
( [RequiresExtension (show gone) | (_, Just x) <- before \\ after, gone <- Map.findWithDefault [] x disappear] ++
274-
[ Note $ "Extension " ++ show x ++ " is " ++ reason x
275-
| (_, Just x) <- explainedRemovals])
276+
[ Note $ "Extension " ++ s ++ " is " ++ reason x
277+
| (s, Just x) <- explainedRemovals])
276278
[ModifyComment (toSS (mkLanguagePragmas sl exts)) newPragma]
277279
| (L sl _, exts) <- languagePragmas $ pragmas (ghcAnnotations x)
278280
, let before = [(x, readExtension x) | x <- exts]

0 commit comments

Comments
 (0)