Add test for pickled refinement types bug (#610).

This commit is contained in:
Grzegorz Kossakowski 2012-12-09 22:42:11 -08:00 committed by Mark Harrah
parent bdfc16b5f4
commit 482b59be5d
7 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,7 @@
InputKey[Unit]("check-number-of-compiler-iterations") <<= inputTask { (argTask: TaskKey[Seq[String]]) =>
(argTask, compile in Compile) map { (args: Seq[String], a: sbt.inc.Analysis) =>
assert(args.size == 1)
val expectedIterationsNumber = args(0).toInt
assert(a.compilations.allCompilations.size == expectedIterationsNumber, "a.compilations.allCompilations.size = %d (expected %d)".format(a.compilations.allCompilations.size, expectedIterationsNumber))
}
}

View File

@ -0,0 +1,5 @@
package test3
class Impl extends B with A with C {
def bleep = println("fooo")
}

View File

@ -0,0 +1,3 @@
package test3
trait A

View File

@ -0,0 +1,9 @@
package test3
trait B { self: A with C =>
class Inner {
def b = B.this
}
def ref: Impl = throw new RuntimeException
}

View File

@ -0,0 +1,3 @@
package test3
trait C { }

View File

@ -0,0 +1,5 @@
package test3
class Impl extends B with A with C {
def bleep = println("foo")
}

View File

@ -0,0 +1,14 @@
# Tests if refinement types are pickled correctly so they
# do not introduce unnecessary compile iterations
# See https://issues.scala-lang.org/browse/SI-6596,
# https://github.com/harrah/xsbt/issues/610
# introduces first compile iteration
> compile
# this change is local to method and does not change api so introduces
# only one additional compile iteration
$ copy-file changes/Impl1.scala src/main/scala/Impl.scala
# second iteration
> compile
# check if there are only two compile iterations performed
> check-number-of-compiler-iterations 2