From e33412d078c544b19b88cd19bfb3b13a71099378 Mon Sep 17 00:00:00 2001 From: Krzysztof Gogolewski Date: Sun, 21 Nov 2021 18:50:40 +0100 Subject: Misc cleanup * Remove `getTag_RDR` (unused), `tidyKind` and `tidyOpenKind` (already available as `tidyType` and `tidyOpenType`) * Remove Note [Explicit Case Statement for Specificity]. Since 0a709dd9876e40 we require GHC 8.10 for bootstrapping. * Change the warning to `cmpAltCon` to a panic. This shouldn't happen. If it ever does, the code was wrong anyway: it shouldn't always return `LT`, but rather `LT` in one case and `GT` in the other case. * Rename `verifyLinearConstructors` to `verifyLinearFields` * Fix `Note [Local record selectors]` which was not referenced * Remove vestiges of `type +v` * Minor fixes to StaticPointers documentation, part of #15603 --- compiler/GHC/HsToCore/Quote.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'compiler/GHC/HsToCore/Quote.hs') diff --git a/compiler/GHC/HsToCore/Quote.hs b/compiler/GHC/HsToCore/Quote.hs index 42d2742bec..6fdd87a0e3 100644 --- a/compiler/GHC/HsToCore/Quote.hs +++ b/compiler/GHC/HsToCore/Quote.hs @@ -2675,7 +2675,7 @@ repH98DataCon con details arg_tys <- repPrefixConArgs ps rep2 normalCName [unC con', unC arg_tys] InfixCon st1 st2 -> do - verifyLinearConstructors [st1, st2] + verifyLinearFields [st1, st2] arg1 <- repBangTy (hsScaledThing st1) arg2 <- repBangTy (hsScaledThing st2) rep2 infixCName [unC arg1, unC con', unC arg2] @@ -2705,8 +2705,8 @@ repGadtDataCons cons details res_ty -- denotes a linear field. -- This check is not performed in repRecConArgs, since the GADT record -- syntax currently does not have a way to mark fields as nonlinear. -verifyLinearConstructors :: [HsScaled GhcRn (LHsType GhcRn)] -> MetaM () -verifyLinearConstructors ps = do +verifyLinearFields :: [HsScaled GhcRn (LHsType GhcRn)] -> MetaM () +verifyLinearFields ps = do linear <- lift $ xoptM LangExt.LinearTypes let allGood = all (\st -> case hsMult st of HsUnrestrictedArrow _ -> not linear @@ -2718,7 +2718,7 @@ verifyLinearConstructors ps = do repPrefixConArgs :: [HsScaled GhcRn (LHsType GhcRn)] -> MetaM (Core [M TH.BangType]) repPrefixConArgs ps = do - verifyLinearConstructors ps + verifyLinearFields ps repListM bangTypeTyConName repBangTy (map hsScaledThing ps) -- Desugar the arguments in a data constructor declared with record syntax. -- cgit v1.2.1