Skip to content

Commit 4df1e67

Browse files
fix wrong match in shrinker (fixes #909)
1 parent 768944e commit 4df1e67

File tree

1 file changed

+2
-2
lines changed
  • core/shared/src/main/scala/org/scalacheck

1 file changed

+2
-2
lines changed

core/shared/src/main/scala/org/scalacheck/Prop.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ object Prop {
773773
/*
774774
* Returns the first failed result in Left or success in Right.
775775
*/
776-
def getFirstFailure(xs: Stream[T], exceptionFilter: Option[Class[_]]): Either[(T,Result),(T,Result)] = {
776+
def getFirstFailure(xs: Stream[T], exceptionFilter: Option[Class[_ <: Throwable]]): Either[(T,Result),(T,Result)] = {
777777
assert(!xs.isEmpty, "Stream cannot be empty")
778778
val results = xs.map(x => (x, result(x)))
779779
results.dropWhile {
@@ -788,7 +788,7 @@ object Prop {
788788
def shrinker(x: T, r: Result, shrinks: Int, orig: T): Result = {
789789
val xs = shrink(x)
790790
val res = r.addArg(Arg(labels,x,shrinks,orig,pp(x),pp(orig)))
791-
val originalException = Some(r.status).collect { case NonFatal(e) => e.getClass() }
791+
val originalException = Some(r.status).collect { case Prop.Exception(e) => e.getClass }
792792
if(xs.isEmpty) res else getFirstFailure(xs, originalException) match {
793793
case Right((x2,r2)) => res
794794
case Left((x2,r2)) => shrinker(x2, replOrig(r,r2), shrinks+1, orig)

0 commit comments

Comments
 (0)