blob: adc9201313ef9b6f068d53fb5f9d6e8c95d1ae3a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
import scala.collection.mutable._
import scala.collection.script._
// #4461
object Test {
def main(args: Array[String]) {
val buf = new ArrayBuffer[Int] with ObservableBuffer[Int]
buf.subscribe(new Subscriber[Message[Int], ObservableBuffer[Int]] {
def notify(pub: ObservableBuffer[Int], event: Message[Int]) = println(event)
})
buf += 1 // works
buf ++= Array(2) // works
buf ++= ArrayBuffer(3, 4) // works
buf ++= List(5) // works
buf ++= collection.immutable.Vector(6, 7) // works
buf.insertAll(7, List(8, 9, 10))
0 +=: buf
List(-2, -1) ++=: buf
buf remove 0
}
}
|