mirror of https://github.com/sbt/sbt.git
Add test for pickled refinement types bug (#610).
This commit is contained in:
parent
bdfc16b5f4
commit
482b59be5d
|
|
@ -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))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
package test3
|
||||||
|
|
||||||
|
class Impl extends B with A with C {
|
||||||
|
def bleep = println("fooo")
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
package test3
|
||||||
|
|
||||||
|
trait A
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
package test3
|
||||||
|
|
||||||
|
trait B { self: A with C =>
|
||||||
|
class Inner {
|
||||||
|
def b = B.this
|
||||||
|
}
|
||||||
|
|
||||||
|
def ref: Impl = throw new RuntimeException
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
package test3
|
||||||
|
|
||||||
|
trait C { }
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
package test3
|
||||||
|
|
||||||
|
class Impl extends B with A with C {
|
||||||
|
def bleep = println("foo")
|
||||||
|
}
|
||||||
|
|
@ -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
|
||||||
Loading…
Reference in New Issue