File: spec-cyclic.scala

package info (click to toggle)
scala 2.11.12-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 62,924 kB
  • sloc: javascript: 28,808; java: 13,415; xml: 3,135; sh: 1,620; python: 756; makefile: 38; awk: 36; ansic: 6
file content (33 lines) | stat: -rw-r--r-- 934 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
trait AbsFun[@specialized -A, @specialized +B] {
  def apply(x: A): B
}

trait MyPartialFunction[-A, +B] extends AnyRef with AbsFun[A, B]

trait ColMap[A, +B] extends MyPartialFunction[A, B] /*with Collection[(A, B)] */

trait ColSorted[K,+A] extends ColRanged[K,A]

trait ColSortedMap[K,+E] extends ColMap[K,E] with ColSorted[K,Tuple2[K,E]]

trait MutMap[A, B] extends AnyRef
      with ColMap[A, B]

trait ColRanged[K, +A] //extends Iterable[A]

trait JclRanged[K,A] extends ColRanged[K,A] //with MutableIterable[A] {

trait JclMap[K,E] extends /*collection.jcl.MutableIterable[Tuple2[K,E]] with*/ MutMap[K,E]

trait JclSorted[K,A] extends ColSorted[K,A] with JclRanged[K,A]

trait JclSortedMap[K,E] extends ColSortedMap[K,E] with JclMap[K,E] with JclSorted[K,Tuple2[K,E]]

class Foo[A, B] extends JclSortedMap[A, B] {
  def apply(x: A): B = sys.error("NYI")
}

class Bar {
  val x: Foo[Int, Int] = new Foo[Int, Int]
  x.apply(0)
}