diff --git a/.travis.yml b/.travis.yml index e9dda917e..801950fba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -60,6 +60,8 @@ matrix: script: - cd scalafix - sbt tests/test + - scala: 0.19.0-RC1 + env: PLATFORM=jvm SBT_PARALLEL=true WORKERS=1 DEPLOY=true exclude: - jdk: openjdk8 env: PLATFORM=jvm SBT_PARALLEL=true WORKERS=4 DEPLOY=false diff --git a/build.sbt b/build.sbt index 52a439978..64e4fcb7a 100644 --- a/build.sbt +++ b/build.sbt @@ -72,7 +72,7 @@ lazy val sharedSettings = MimaSettings.settings ++ scalaVersionSettings ++ Seq( }, unmanagedSourceDirectories in Compile += { - val s = if (scalaMajorVersion.value >= 13) "+" else "-" + val s = if (scalaMajorVersion.value >= 13 || isDotty.value) "+" else "-" (baseDirectory in LocalRootProject).value / "src" / "main" / s"scala-2.13$s" }, @@ -96,7 +96,10 @@ lazy val sharedSettings = MimaSettings.settings ++ scalaVersionSettings ++ Seq( "-Ywarn-unused:-patvars,-implicits,-locals,-privates,-explicits")) val n = scalaMajorVersion.value - groups.flatMap(f => f(n)) + if (isDotty.value) + Seq("-language:Scala2") + else + groups.flatMap(f => f(n)) }, // HACK: without these lines, the console is basically unusable, @@ -112,7 +115,7 @@ lazy val sharedSettings = MimaSettings.settings ++ scalaVersionSettings ++ Seq( val isScalaJSMilestone: Boolean = scalaJSVersion.startsWith("1.0.0-M") // TODO: re-enable MiMa for 2.14 once there is a final version - if (scalaMajorVersion.value == 14 || isScalaJSMilestone) Set() + if (scalaMajorVersion.value == 14 || isScalaJSMilestone || isDotty.value) Set() else Set("org.scalacheck" %%% "scalacheck" % "1.14.2") }, @@ -166,6 +169,7 @@ lazy val js = project.in(file("js")) lazy val jvm = project.in(file("jvm")) .settings(sharedSettings: _*) .settings( + crossScalaVersions += "0.19.0-RC1", fork in Test := { // Serialization issue in 2.13 scalaMajorVersion.value == 13 // ==> true diff --git a/project/MimaSettings.scala b/project/MimaSettings.scala index e955020e8..1d0764d53 100644 --- a/project/MimaSettings.scala +++ b/project/MimaSettings.scala @@ -19,6 +19,7 @@ object MimaSettings { ) private def removedPrivateMethods = Seq( + "org.scalacheck.Prop.BooleanOperators" ) private def removedPrivateClasses = Seq( diff --git a/project/plugin.sbt b/project/plugin.sbt index 880582507..939799b40 100644 --- a/project/plugin.sbt +++ b/project/plugin.sbt @@ -2,6 +2,8 @@ addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.6.1") addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.0") +addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.3.4") + def env(name: String): Option[String] = Option(System.getenv(name)) diff --git a/src/main/scala-2.13+/org/scalacheck/util/BuildableVersionSpecific.scala b/src/main/scala-2.13+/org/scalacheck/util/BuildableVersionSpecific.scala index 3c7e15d56..eceede8ab 100644 --- a/src/main/scala-2.13+/org/scalacheck/util/BuildableVersionSpecific.scala +++ b/src/main/scala-2.13+/org/scalacheck/util/BuildableVersionSpecific.scala @@ -16,7 +16,7 @@ import scala.collection.mutable.Builder private[util] trait BuildableVersionSpecific { - implicit def buildableFactory[T,C](implicit f: Factory[T,C]) = + implicit def buildableFactory[T,C](implicit f: Factory[T,C]): Buildable[T,C] = new Buildable[T,C] { def builder = f.newBuilder } diff --git a/src/main/scala/org/scalacheck/Gen.scala b/src/main/scala/org/scalacheck/Gen.scala index 17e322d4b..ff5f8adb2 100644 --- a/src/main/scala/org/scalacheck/Gen.scala +++ b/src/main/scala/org/scalacheck/Gen.scala @@ -417,7 +417,7 @@ object Gen extends GenArities with GenVersionSpecific { new Choose[Long] { def choose(low: Long, high: Long): Gen[Long] = if (low > high) throw new IllegalBoundsError(low, high) - else gen(chLng(low,high)) + else gen(chLng(low,high)) } implicit val chooseInt: Choose[Int] = diff --git a/src/main/scala/org/scalacheck/Prop.scala b/src/main/scala/org/scalacheck/Prop.scala index 2a5a77c5f..0fef8e766 100644 --- a/src/main/scala/org/scalacheck/Prop.scala +++ b/src/main/scala/org/scalacheck/Prop.scala @@ -334,7 +334,7 @@ object Prop { /** A collection of property operators on `Boolean` values. * Import [[Prop.propBoolean]] to make the operators available. * The availability of this class as an implicit via - * [[#BooleanOperators]] will be removed in 1.15.0. */ + * `BooleanOperators` was removed in 1.15.0. */ class ExtendedBoolean(b: => Boolean) { /** See the documentation for [[org.scalacheck.Prop]] */ def ==>(p: => Prop) = Prop(b) ==> p @@ -357,7 +357,7 @@ object Prop { * values available in the current scope. See [[Prop.ExtendedBoolean]] for * documentation on the operators. */ @deprecated("Please import Prop.propBoolean instead", since="1.14.1") - implicit def BooleanOperators(b: => Boolean): ExtendedBoolean = new ExtendedBoolean(b) + implicit private[this] def BooleanOperators(b: => Boolean): ExtendedBoolean = new ExtendedBoolean(b) /** Implicit conversion of Boolean values to Prop values. */ implicit def propBoolean(b: Boolean): Prop = Prop(b) diff --git a/src/main/scala/org/scalacheck/util/Pretty.scala b/src/main/scala/org/scalacheck/util/Pretty.scala index 4e3e394e0..ed93c0171 100644 --- a/src/main/scala/org/scalacheck/util/Pretty.scala +++ b/src/main/scala/org/scalacheck/util/Pretty.scala @@ -148,7 +148,7 @@ object Pretty { (xs,r) <- fm.getRatios ys = xs - (()) if !ys.isEmpty - } yield round(r*100)+"% " + ys.mkString(", ") + } yield round(r*100).toString + "% " + ys.mkString(", ") }.mkString("\n") } }