Pending test case for abstract type override flag (#726)

This test case demonstrates spurious recompilation described
in #726.
This commit is contained in:
Grzegorz Kossakowski 2013-04-20 16:13:58 -07:00
parent 7689343ba0
commit e97a7ac228
6 changed files with 36 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,4 @@
object Bar {
def bar: Outer.TypeInner = null
// comment to trigger recompilation
}

View File

@ -0,0 +1,14 @@
# Test for separate compilation and proper value of
# the OVERRIDE flag when abstract types, type alias
# and structural type are involved
# See https://github.com/sbt/sbt/issues/726 for details
# introduces first compile iteration
> compile
# this change adds a comment and does not change api so introduces
# only one additional compile iteration
$ copy-file changes/Bar1.scala src/main/scala/Bar.scala
# second iteration
#> compile
# check if there are only two compile iterations performed
> check-number-of-compiler-iterations 2

View File

@ -0,0 +1,3 @@
object Bar {
def bar: Outer.TypeInner = null
}

View File

@ -0,0 +1,5 @@
object Outer {
class Inner { type Xyz }
type TypeInner = Inner { type Xyz = Int }
}

View File

@ -0,0 +1,3 @@
class Impl {
def bleep = Bar.bar
}