mirror of https://github.com/sbt/sbt.git
This commit is contained in:
parent
ce9b43e9bd
commit
9a79af69c9
|
|
@ -0,0 +1,6 @@
|
|||
trait A {
|
||||
def x: Int
|
||||
}
|
||||
class E extends A {
|
||||
def x = 19
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
trait B extends A {
|
||||
abstract override def x = 1
|
||||
}
|
||||
trait C extends A {
|
||||
abstract override def x = 3
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
class X extends E with C with B
|
||||
|
||||
object Main {
|
||||
|
||||
def main(args: Array[String]) {
|
||||
val x = new X
|
||||
val expected = args(0).toInt
|
||||
assert(x.x == expected, "Expected " + expected + ", got " + x.x)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
trait B extends A {
|
||||
abstract override def x = super.x + 2
|
||||
}
|
||||
trait C extends A {
|
||||
abstract override def x = 3
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
trait B extends A {
|
||||
abstract override def x = super.x + 2
|
||||
}
|
||||
trait C extends A {
|
||||
abstract override def x = super.x
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
# This test verifies that adding/removing calls to super in traits properly
|
||||
# recompiles subclasses. super calls introduce accessors that are not in
|
||||
# the public API, so this is not picked up by the usual API change detection.
|
||||
|
||||
> run 1
|
||||
|
||||
$ copy-file changes/B2.scala B.scala
|
||||
> run 5
|
||||
|
||||
$ copy-file changes/B3.scala B.scala
|
||||
> run 21
|
||||
|
||||
Loading…
Reference in New Issue