diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2021-05-11 18:06:05 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-05-12 21:42:21 -0400 |
commit | c34f4c0cf55ac5c81b6600daab2a66e0adf89f50 (patch) | |
tree | f910e2f97e105e2cd4705421d8195206418e2a64 /utils | |
parent | 67a5a91ef5e61f3b3c84481d8a396ed48cd5d96e (diff) | |
download | haskell-c34f4c0cf55ac5c81b6600daab2a66e0adf89f50.tar.gz |
EPA: Fix incorrect SrcSpan for FamDecl
The SrcSpan for a type family declaration did not include the family
equations.
Closes #19821
Diffstat (limited to 'utils')
-rw-r--r-- | utils/check-exact/ExactPrint.hs | 6 | ||||
-rw-r--r-- | utils/check-exact/Main.hs | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/utils/check-exact/ExactPrint.hs b/utils/check-exact/ExactPrint.hs index 454db7fce4..e4319bebf0 100644 --- a/utils/check-exact/ExactPrint.hs +++ b/utils/check-exact/ExactPrint.hs @@ -2778,7 +2778,11 @@ instance ExactPrint (FamilyDecl GhcPs) where exact_top_level exactVanillaDeclHead an ltycon tyvars fixity Nothing exact_kind - mapM_ markAnnotated mb_inj + case mb_inj of + Nothing -> return () + Just inj -> do + markEpAnn an AnnVbar + markAnnotated inj case info of ClosedTypeFamily mb_eqns -> do markEpAnn an AnnWhere diff --git a/utils/check-exact/Main.hs b/utils/check-exact/Main.hs index 147747d560..f9883fee83 100644 --- a/utils/check-exact/Main.hs +++ b/utils/check-exact/Main.hs @@ -186,7 +186,8 @@ _tt = testOneFile changers "/home/alanz/mysrc/git.haskell.org/worktree/exactprin -- "../../testsuite/tests/ghc-api/exactprint/Windows.hs" Nothing -- "../../testsuite/tests/printer/Test19784.hs" Nothing -- "../../testsuite/tests/printer/Test19813.hs" Nothing - "../../testsuite/tests/printer/Test19814.hs" Nothing + -- "../../testsuite/tests/printer/Test19814.hs" Nothing + "../../testsuite/tests/printer/Test19821.hs" Nothing -- cloneT does not need a test, function can be retired |