Skip to content

Commit 6228183

Browse files
fix
1 parent ea2e47c commit 6228183

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Constrained/Conformance.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module Constrained.Conformance (
1414
conformsToSpec,
1515
conformsToSpecE,
1616
satisfies,
17+
checkPredE,
1718
checkPredsE,
1819
) where
1920

src/Constrained/Generation.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ shrinkFromPreds :: HasSpec a => Pred -> Var a -> a -> [a]
167167
shrinkFromPreds p
168168
| Result plan <- prepareLinearization p = \x a -> listFromGE $ do
169169
-- NOTE: we do this to e.g. guard against bad construction functions in Exists
170-
xaGood <- checkPred (Env.singleton x a) p
171-
unless xaGood $
172-
fatalError "Trying to shrink a bad value, don't do that!"
170+
case checkPredE (Env.singleton x a) (NE.fromList []) p of
171+
Nothing -> pure ()
172+
Just err -> explainNE err $ fatalError "Trying to shrink a bad value, don't do that!"
173173
-- Get an `env` for the original value
174174
initialEnv <- envFromPred (Env.singleton x a) p
175175
return

0 commit comments

Comments
 (0)