mirror of https://github.com/sbt/sbt.git
Merge branch 'override-abstract-type-dealias-kept' of https://github.com/gkossakowski/xsbt into 0.13
This commit is contained in:
commit
77b7c60e2b
|
|
@ -312,9 +312,13 @@ final class API(val global: CallbackGlobal) extends Compat
|
||||||
private def processType(in: Symbol, t: Type): xsbti.api.Type = typeCache.getOrElseUpdate((in, t), makeType(in, t))
|
private def processType(in: Symbol, t: Type): xsbti.api.Type = typeCache.getOrElseUpdate((in, t), makeType(in, t))
|
||||||
private def makeType(in: Symbol, t: Type): xsbti.api.Type =
|
private def makeType(in: Symbol, t: Type): xsbti.api.Type =
|
||||||
{
|
{
|
||||||
def dealias(t: Type) = t match { case TypeRef(_, sym, _) if sym.isAliasType => t.normalize; case _ => t }
|
|
||||||
|
|
||||||
dealias(t) match
|
val dealiased = t match {
|
||||||
|
case TypeRef(_, sym, _) if sym.isAliasType => t.dealias
|
||||||
|
case _ => t
|
||||||
|
}
|
||||||
|
|
||||||
|
dealiased match
|
||||||
{
|
{
|
||||||
case NoPrefix => Constants.emptyType
|
case NoPrefix => Constants.emptyType
|
||||||
case ThisType(sym) => new xsbti.api.Singleton(thisPath(sym))
|
case ThisType(sym) => new xsbti.api.Singleton(thisPath(sym))
|
||||||
|
|
|
||||||
|
|
@ -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,4 @@
|
||||||
|
object Bar {
|
||||||
|
def bar: Outer.TypeInner = null
|
||||||
|
// comment to trigger recompilation
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
object Bar {
|
||||||
|
def bar: Outer.TypeInner = null
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
object Outer {
|
||||||
|
class Inner { type Xyz }
|
||||||
|
|
||||||
|
type TypeInner = Inner { type Xyz = Int }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
class Impl {
|
||||||
|
def bleep = Bar.bar
|
||||||
|
}
|
||||||
|
|
@ -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
|
||||||
Loading…
Reference in New Issue