From a39813445873e41ff1227494ef790b4bb20dd8ee Mon Sep 17 00:00:00 2001 From: Antonis Geralis Date: Wed, 14 Sep 2022 12:16:30 +0300 Subject: [PATCH] omg it works --- drchaos/mutator.nim | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/drchaos/mutator.nim b/drchaos/mutator.nim index 4f3c3d8..6c356d0 100644 --- a/drchaos/mutator.nim +++ b/drchaos/mutator.nim @@ -262,7 +262,7 @@ template sampleAttempt(call: untyped) = proc sample[T: distinct](x: T; s: var Sampler; r: var Rand; res: var int) = when compiles(mutate(x, 0, false, r)): - sampleAttempt(attempt(s, r, DefaultMutateWeight, res)) # distinct bool lol + sampleAttempt(attempt(s, r, DefaultMutateWeight, res)) else: sample(x.distinctBase, s, r, res) @@ -283,6 +283,9 @@ proc sample[T: SomeNumber](x: T; s: var Sampler; r: var Rand; res: var int) = proc sample[T](x: seq[T]; s: var Sampler; r: var Rand; res: var int) = sampleAttempt(attempt(s, r, DefaultMutateWeight, res)) + when T is PostProcessTypes: + for i in 0..