All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scalaprops.GenInstances1.scala Maven / Gradle / Ivy

The newest version!
package scalaprops

abstract class GenInstances1 extends GenInstances {
  implicit def javaEnumGen[A <: java.lang.Enum[A]](implicit A: reflect.ClassTag[A]): Gen[A] = {
    val array = A.runtimeClass.getEnumConstants.asInstanceOf[Array[A]]
    Gen.choose(0, array.length - 1).map(array)
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy