diff --git a/Sources/PropertyBased/Gen+Frequency.swift b/Sources/PropertyBased/Gen+Frequency.swift index 604bcf3..39b210c 100644 --- a/Sources/PropertyBased/Gen+Frequency.swift +++ b/Sources/PropertyBased/Gen+Frequency.swift @@ -85,7 +85,7 @@ extension Gen { let pick = FloatLiteralType.random(in: 0.. pick }! as Int - return (index: index, value: options[index].gen._runIntermediate(&rng)) + return (index: index, value: options[index].gen.runFull(&rng).input) }, shrink: { pair in let opt = options[pair.index] diff --git a/Sources/PropertyBased/Generator.swift b/Sources/PropertyBased/Generator.swift index 7b34b26..959406f 100644 --- a/Sources/PropertyBased/Generator.swift +++ b/Sources/PropertyBased/Generator.swift @@ -34,9 +34,11 @@ public struct Generator: Send /// Run the generator until a single unfiltered value is found. @inlinable - internal func runFull(_ rng: inout G) -> sending ( - input: InputValue, result: ResultValue - ) { + internal func runFull(_ rng: inout G) + -> sending ( + input: InputValue, result: ResultValue + ) + { var arng: any SeededRandomNumberGenerator = rng defer { rng = arng as! G }