Skip to content

Commit

Permalink
Compile in dotty 0.19.0-RC1
Browse files Browse the repository at this point in the history
  • Loading branch information
ashawley committed Nov 22, 2019
1 parent 294abd7 commit dbaeb80
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},

Expand All @@ -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,
Expand All @@ -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")
},

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions project/MimaSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ object MimaSettings {
)

private def removedPrivateMethods = Seq(
"org.scalacheck.Prop.BooleanOperators"
)

private def removedPrivateClasses = Seq(
Expand Down
2 changes: 2 additions & 0 deletions project/plugin.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/org/scalacheck/Gen.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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] =
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/org/scalacheck/Prop.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/org/scalacheck/util/Pretty.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
Expand Down

0 comments on commit dbaeb80

Please sign in to comment.