packages feed

sydtest-mutation-plugin 0.5.1.0 → 0.5.2.0

raw patch · API changes only · 10 files changed · show whitespace changes · browse sydtest-mutation-plugin-0.5.2.0

+36/−31 lines, 10 filesdep ~ghc

Dependency ranges changed: ghc

API changes (from Hackage documentation)

No API comparison: Hackage has no documentation for sydtest-mutation-plugin-0.5.1.0; Hackage has no documentation for sydtest-mutation-plugin-0.5.2.0.

Files

CHANGELOG.md view
@@ -1,5 +1,11 @@ # Changelog +## [0.5.2.0] - 2026-12-04++### Changed++* Ported to GHC 9.12, which is now the minimum supported GHC version.+ ## [0.5.1.0] - 2026-10-13  ### Changed
src/Test/Syd/Mutation/Plugin/Instrument.hs view
@@ -61,7 +61,6 @@ import GHC.Core.Predicate (isEvVar) import GHC.Core.TyCo.Rep (Scaled (..)) import GHC.Core.Type (isLiftedTypeKind, typeKind)-import GHC.Data.Bag (mapBagM) import GHC.Data.FastString (mkFastString) import GHC.Driver.Env (HscEnv (..)) import GHC.Driver.Session (WarningFlag (..), wopt_set)@@ -529,7 +528,7 @@ -- Bind walkers  instrumentBinds :: LHsBinds GhcTc -> InstrM (LHsBinds GhcTc)-instrumentBinds = mapBagM (traverse instrumentBind)+instrumentBinds = mapM (traverse instrumentBind)  instrumentBind :: HsBind GhcTc -> InstrM (HsBind GhcTc) instrumentBind = \case@@ -580,7 +579,7 @@   -- the inner binds, which withFunBindEnv would otherwise miss.   XHsBindsLR ab@AbsBinds {abs_binds, abs_exports} -> do     let polyNames = map (idName . abe_poly) abs_exports-    binds' <- foldr withFunBindEnv (mapBagM (traverse instrumentBind) abs_binds) polyNames+    binds' <- foldr withFunBindEnv (mapM (traverse instrumentBind) abs_binds) polyNames     pure (XHsBindsLR ab {abs_binds = binds'})  -- | Record @name@ as the enclosing top-level binding for the wrapped action,@@ -1225,10 +1224,10 @@ instrumentValBinds :: HsValBinds GhcTc -> InstrM (HsValBinds GhcTc) instrumentValBinds = \case   ValBinds x binds sigs ->-    ValBinds x <$> mapBagM (traverse instrumentBind) binds <*> pure sigs+    ValBinds x <$> mapM (traverse instrumentBind) binds <*> pure sigs   XValBindsLR (NValBinds binds sigs) ->     XValBindsLR . flip NValBinds sigs-      <$> mapM (\(f, bag) -> (f,) <$> mapBagM (traverse instrumentBind) bag) binds+      <$> mapM (\(f, bs) -> (f,) <$> mapM (traverse instrumentBind) bs) binds  -- --------------------------------------------------------------------------- -- Expression walkers@@ -1385,8 +1384,8 @@                 Just c -> env {instrumentEnvOpAppCtx = Just c}                 Nothing -> env           XExpr . ExpandedThingTc orig <$> local updateEnv (instrumentExpr _sp expanded)-  XExpr (WrapExpr (HsWrap co e)) ->-    XExpr . WrapExpr . HsWrap co <$> instrumentExpr _sp e+  XExpr (WrapExpr co e) ->+    XExpr . WrapExpr co <$> instrumentExpr _sp e   e -> pure e  -- | True when an 'HsThingRn' wraps the unexpanded form of a TH splice or@@ -1447,7 +1446,7 @@ constructorName :: LHsExpr GhcTc -> Maybe Name constructorName le = case unLoc le of   XExpr (ConLikeTc con _ _) -> Just (conLikeName con)-  XExpr (WrapExpr (HsWrap _ e)) -> constructorName (noLocA e)+  XExpr (WrapExpr _ e) -> constructorName (noLocA e)   HsAppType _ f _ -> constructorName f   HsPar _ e -> constructorName e   _ -> Nothing@@ -1575,8 +1574,8 @@  instrumentRecordBinds :: HsRecordBinds GhcTc -> InstrM (HsRecordBinds GhcTc) instrumentRecordBinds = \case-  HsRecFields flds md ->-    HsRecFields+  HsRecFields recExt flds md ->+    HsRecFields recExt       <$> mapM (traverse (\(HsFieldBind x l e pun) -> HsFieldBind x l <$> instrumentLExpr e <*> pure pun)) flds       <*> pure md @@ -1780,7 +1779,7 @@   let pat = noLocA (VarPat NoExtField (noLocA ctrlId))       grhs = noLocA (GRHS noAnn [] body)       grhss = GRHSs emptyComments [grhs] (EmptyLocalBinds NoExtField)-      match = noLocA (Match [] (LamAlt LamSingle) [pat] grhss)+      match = noLocA (Match NoExtField (LamAlt LamSingle) (L noAnn [pat]) grhss)       mgtc =         MatchGroupTc           { mg_arg_tys = [Scaled manyDataConTy ty],@@ -1788,7 +1787,7 @@             mg_origin = Generated OtherExpansion SkipPmc           }       mg = MG mgtc (noLocA [match])-      lam = noLocA (HsLam [] LamSingle mg)+      lam = noLocA (HsLam noAnn LamSingle mg)   pure (mkHsApp lam e)  -- | Record one mutation site, returning its 'MutationId' and (when the
src/Test/Syd/Mutation/Plugin/Operator/BoolLit.hs view
@@ -16,7 +16,7 @@       operatorKind = ExpressionOperator $ fmap action . extractBoolLit     } --- | Extract the OccName of a boolean literal, unwrapping HsWrap and+-- | Extract the OccName of a boolean literal, unwrapping WrapExpr and -- ConLikeTc nodes that GHC inserts after type-checking. extractBoolLit :: LHsExpr GhcTc -> Maybe String extractBoolLit = \case@@ -24,7 +24,7 @@     | occ <- getOccString v, occ `elem` boolLits -> Just occ   L _ (XExpr (ConLikeTc con _ _))     | occ <- getOccString con, occ `elem` boolLits -> Just occ-  L _ (XExpr (WrapExpr (HsWrap _ e))) -> extractBoolLit (noLocA e)+  L _ (XExpr (WrapExpr _ e)) -> extractBoolLit (noLocA e)   _ -> Nothing  boolLits :: [String]
src/Test/Syd/Mutation/Plugin/Operator/ConstBool.hs view
@@ -45,12 +45,12 @@   _ -> False  -- | Returns True for boolean literals and 'otherwise' (which equals True),--- unwrapping HsWrap and ConLikeTc nodes that GHC inserts after type-checking.+-- unwrapping WrapExpr and ConLikeTc nodes that GHC inserts after type-checking. isBoolLit :: LHsExpr GhcTc -> Bool isBoolLit = \case   L _ (HsVar _ (L _ v)) -> getOccString v `elem` ["True", "False", "otherwise"]   L _ (XExpr (ConLikeTc con _ _)) -> getOccString con `elem` ["True", "False"]-  L _ (XExpr (WrapExpr (HsWrap _ e))) -> isBoolLit (noLocA e)+  L _ (XExpr (WrapExpr _ e)) -> isBoolLit (noLocA e)   _ -> False  action ::
src/Test/Syd/Mutation/Plugin/Operator/ConstConstructor.hs view
@@ -244,7 +244,7 @@   L _ (HsAppType _ f _) -> constructorHead f   L _ (HsPar _ e) -> constructorHead e   L _ (ExprWithTySig _ e _) -> constructorHead e-  L _ (XExpr (WrapExpr (HsWrap _ e))) -> constructorHead (noLocA e)+  L _ (XExpr (WrapExpr _ e)) -> constructorHead (noLocA e)   L _ (XExpr (ExpandedThingTc _ e)) -> constructorHead (noLocA e)   _ -> Nothing 
src/Test/Syd/Mutation/Plugin/Operator/MaybeOp.hs view
@@ -30,7 +30,7 @@ funOccName = \case   L _ (HsVar _ (L _ v)) -> Just (getOccString v)   L _ (XExpr (ConLikeTc con _ _)) -> Just (getOccString con)-  L _ (XExpr (WrapExpr (HsWrap _ e))) -> funOccName (noLocA e)+  L _ (XExpr (WrapExpr _ e)) -> funOccName (noLocA e)   _ -> Nothing  action ::
src/Test/Syd/Mutation/Plugin/Operator/RemoveAction.hs view
@@ -110,7 +110,7 @@   SrcSpanAnnA ->   XDo GhcTc ->   HsDoFlavour ->-  SrcSpanAnnL ->+  SrcSpanAnnLW ->   [ExprLStmt GhcTc] ->   Type ->   InstrM [MutationAlt]
src/Test/Syd/Mutation/Plugin/Operator/RemoveCase.hs view
@@ -23,7 +23,7 @@   XCase GhcTc ->   LHsExpr GhcTc ->   XMG GhcTc (LHsExpr GhcTc) ->-  SrcSpanAnnL ->+  SrcSpanAnnLW ->   [LMatch GhcTc (LHsExpr GhcTc)] ->   Type ->   InstrM [MutationAlt]
src/Test/Syd/Mutation/Plugin/Operator/Util.hs view
@@ -64,7 +64,7 @@ opName :: LHsExpr GhcTc -> Maybe Name opName = \case   L _ (HsVar _ (L _ v)) -> Just (idName v)-  L _ (XExpr (WrapExpr (HsWrap _ e))) -> opName (noLocA e)+  L _ (XExpr (WrapExpr _ e)) -> opName (noLocA e)   L _ (XExpr (ExpandedThingTc _ e)) -> opName (noLocA e)   L _ (HsApp _ f a)     | Just n <- opName f, getOccString n == "$" -> opName a@@ -161,7 +161,7 @@ -- | Skip outermost 'WrapExpr' layers. unwrapWrap :: HsExpr GhcTc -> HsExpr GhcTc unwrapWrap = \case-  XExpr (WrapExpr (HsWrap _ inner)) -> unwrapWrap inner+  XExpr (WrapExpr _ inner) -> unwrapWrap inner   e -> e  -- | Build the mutated infix application by substituting the operator id.@@ -198,8 +198,8 @@     substOpId :: Id -> LHsExpr GhcTc -> LHsExpr GhcTc     substOpId newId = \case       L ann (HsVar x (L l' _)) -> L ann (HsVar x (L l' newId))-      L ann (XExpr (WrapExpr (HsWrap w e))) ->-        L ann (XExpr (WrapExpr (HsWrap w (unLoc (substOpId newId (noLocA e))))))+      L ann (XExpr (WrapExpr w e)) ->+        L ann (XExpr (WrapExpr w (unLoc (substOpId newId (noLocA e)))))       L ann (HsApp x f a) -> L ann (HsApp x (substOpId newId f) a)       L ann (HsAppType x f t) -> L ann (HsAppType x (substOpId newId f) t)       L ann (HsPar x e) -> L ann (HsPar x (substOpId newId e))@@ -218,7 +218,7 @@ substIntegerInWitness n = \case   HsApp x f arg -> HsApp x f (fmap (substIntegerInWitness n) arg)   HsLit x (HsInteger src _ ty) -> HsLit x (HsInteger src n ty)-  XExpr (WrapExpr (HsWrap w e)) -> XExpr (WrapExpr (HsWrap w (substIntegerInWitness n e)))+  XExpr (WrapExpr w e) -> XExpr (WrapExpr w (substIntegerInWitness n e))   e -> e  -- | Result of matching an expression for the @Const…@ family of operators:@@ -331,7 +331,7 @@       HsApp _ f _ -> go f       HsAppType _ f _ -> go f       HsPar _ e -> go e-      XExpr (WrapExpr (HsWrap _ e)) -> go (L (getLoc h) e)+      XExpr (WrapExpr _ e) -> go (L (getLoc h) e)       XExpr (ExpandedThingTc _ e) -> go (L (getLoc h) e)       _ -> Just () @@ -359,7 +359,7 @@       grhs = noLocA (GRHS noAnn [] body)       grhss = GRHSs emptyComments [grhs] (EmptyLocalBinds NoExtField)       ctxt = LamAlt LamSingle-      match = noLocA (Match [] ctxt pats grhss)+      match = noLocA (Match NoExtField ctxt (L noAnn pats) grhss)       mgtc =         MatchGroupTc           { mg_arg_tys = map (Scaled manyDataConTy) argTys,@@ -367,7 +367,7 @@             mg_origin = Generated OtherExpansion SkipPmc           }       mg = MG mgtc (noLocA [match])-   in noLocA (HsLam [] LamSingle mg)+   in noLocA (HsLam noAnn LamSingle mg)  -- | Build an arrow type @arg1 -> ... -> argN -> resTy@ with default (Many) -- multiplicity.@@ -432,7 +432,7 @@   where     go le = case unLoc le of       HsVar _ (L _ v) -> Just (idName v)-      XExpr (WrapExpr (HsWrap _ e)) -> go (noLocA e)+      XExpr (WrapExpr _ e) -> go (noLocA e)       HsAppType _ f _ -> go f       HsPar _ e -> go e       _ -> Nothing
sydtest-mutation-plugin.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           sydtest-mutation-plugin-version:        0.5.1.0+version:        0.5.2.0 synopsis:       GHC plugin that instruments code for sydtest's mutation testing description:    A GHC source plugin that instruments code under test with the coverage and mutation hooks that sydtest's mutation testing infrastructure needs. See https://github.com/NorfairKing/sydtest#readme for more information. category:       Testing@@ -61,7 +61,7 @@     , containers     , directory     , filepath-    , ghc+    , ghc >=9.12     , ghc-boot     , mtl     , opt-env-conf