mirror of https://github.com/sbt/sbt.git
Add test for pickled existential types bug (#616)
This test fails at the moment because there's one unnecessary compile iteration performed. Thus the test is marked as pending. Since the test is compiler version specific, I set it to 2.9.2 (latest stable version).
This commit is contained in:
parent
78b0f485fa
commit
bdfc16b5f4
|
|
@ -0,0 +1,12 @@
|
|||
logLevel := Level.Debug
|
||||
|
||||
scalaVersion := "2.9.2"
|
||||
|
||||
// dumps analysis into target/analysis-dump.txt file
|
||||
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 test6
|
||||
|
||||
class B extends A {
|
||||
def wibble = println("fooo")
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
# Tests if existential types are pickled correctly so they
|
||||
# do not introduce unnecessary compile iterations
|
||||
|
||||
# introduces first compile iteration
|
||||
> compile
|
||||
# this change is local to a method and does not change the api so introduces
|
||||
# only one additional compile iteration
|
||||
$ copy-file changes/B1.scala src/main/scala/B.scala
|
||||
# second iteration
|
||||
> compile
|
||||
# check if there are only two compile iterations being performed
|
||||
> check-number-of-compiler-iterations 2
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package test6
|
||||
|
||||
trait A {
|
||||
object Foo extends Module[Foo[_]]
|
||||
|
||||
class Foo[TResult]
|
||||
|
||||
def b = new B
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package test6
|
||||
|
||||
class B extends A {
|
||||
def wibble = println("foo")
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package test6
|
||||
|
||||
class Module[T]
|
||||
Loading…
Reference in New Issue