Skip to content

Commit

Permalink
Merge pull request #325 from WiWa/d/betterRscCompat
Browse files Browse the repository at this point in the history
Fixes for #320 and #322
  • Loading branch information
xeno-by authored Jan 17, 2019
2 parents c7a25e5 + f7021b5 commit 1760f14
Show file tree
Hide file tree
Showing 118 changed files with 25,543 additions and 13 deletions.
22 changes: 19 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ lazy val examplesFunction = project
.in(file("examples/function"))
.settings(commonSettings)

lazy val examplesOriginalCore = project
.in(file("examples/original/core"))
.dependsOn(examplesFunction)
.settings(
commonSettings,
semanticdbSettings,
libraryDependencies += "org.scala-lang" % "scala-reflect" % V.scala,
libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.4"
)

lazy val examplesSemantic = project
.in(file("examples/semantic"))
.dependsOn(examplesDependencies)
Expand Down Expand Up @@ -146,9 +156,15 @@ lazy val scalafixTests = project
.settings(
commonSettings,
libraryDependencies += "ch.epfl.scala" % "scalafix-testkit" % V.scalafix % Test cross CrossVersion.full,
scalafixTestkitOutputSourceDirectories := sourceDirectories.in(scalafixOutput, Compile).value,
scalafixTestkitInputSourceDirectories := sourceDirectories.in(scalafixInput, Compile).value,
scalafixTestkitInputClasspath := fullClasspath.in(scalafixInput, Compile).value
scalafixTestkitOutputSourceDirectories :=
sourceDirectories.in(scalafixOutput, Compile).value ++
sourceDirectories.in(examplesCore, Compile).value,
scalafixTestkitInputSourceDirectories :=
sourceDirectories.in(scalafixInput, Compile).value ++
sourceDirectories.in(examplesOriginalCore, Compile).value,
scalafixTestkitInputClasspath :=
fullClasspath.in(scalafixInput, Compile).value ++
fullClasspath.in(examplesOriginalCore, Compile).value
)

lazy val scalasig = project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class BoundedStack[A: ClassTag](val maxSize: Int) extends Seq[A] {
}
}

override def iterator: AnyRef with Iterator[A] = new Iterator[A] {
override def iterator: Iterator[A] = new Iterator[A] {
var idx = 0
def hasNext = idx != count_
def next = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ trait Disposable[+T] {
}

object Disposable {
def const[T](t: T): AnyRef with Disposable[T] = new Disposable[T] {
def const[T](t: T): Disposable[T] = new Disposable[T] {
def get = t
def dispose(deadline: Time) = Future.value(())
}
Expand Down Expand Up @@ -131,8 +131,8 @@ trait Managed[+T] { selfT =>
}

object Managed {
def singleton[T](t: Disposable[T]): AnyRef with Managed[T] = new Managed[T] { def make() = t }
def const[T](t: T): AnyRef with Managed[T] = singleton(Disposable.const(t))
def singleton[T](t: Disposable[T]): Managed[T] = new Managed[T] { def make() = t }
def const[T](t: T): Managed[T] = singleton(Disposable.const(t))
}

class DoubleTrouble(cause1: Throwable, cause2: Throwable) extends Exception {
Expand Down
2 changes: 1 addition & 1 deletion examples/core/src/main/scala/com/twitter/util/Event.scala
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ trait Event[+T] { self =>
* builder. A value containing the current version of the collection
* is notified for each incoming event.
*/
def build[U >: T, That](implicit cbf: CanBuild[U, That]): AnyRef with Event[That] = new Event[That] {
def build[U >: T, That](implicit cbf: CanBuild[U, That]): Event[That] = new Event[That] {
def register(s: Witness[That]): Closable = {
val b = cbf()
self.respond { t =>
Expand Down
2 changes: 1 addition & 1 deletion examples/core/src/main/scala/com/twitter/util/Var.scala
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ private object UpdatableVar {
def :=(newv: T): State[T] = copy(value = newv, version = version + 1)
}

implicit def order[T]: Object with Ordering[Party[T]] = new Ordering[Party[T]] {
implicit def order[T]: Ordering[Party[T]] = new Ordering[Party[T]] {
// This is safe because observers are compared
// only from the same counter.
def compare(a: Party[T], b: Party[T]): Int = {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
rules = "scala:rsc.rules.RscCompat"
*/
// workaround for https://github.com/pantsbuild/pants/issues/6678
private final class PantsWorkaroundCore {
throw new IllegalStateException("workaround for https://github.com/pantsbuild/pants/issues/6678")
}
Loading

0 comments on commit 1760f14

Please sign in to comment.