File: t8046.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 (20 lines) | stat: -rw-r--r-- 596 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
trait One {
  type Op[A]
  type Alias[A] = Op[A]
}
 
trait Two extends One {
  trait Op[A] extends (A => A)
 
  // This compiles
  class View1 extends Op[Int] { def apply(xs: Int) = xs }
 
  // ??? base class View2 not found in basetypes of class View2
  // ./a.scala:9: error: class View2 needs to be abstract, since \
  //   method apply in trait Function1 of type (v1: T1)R is not defined
  // (Note that T1 does not match Int)
  //   class View2 extends Alias[Int] { def apply(xs: Int) = xs }
  //         ^
  // one error found
  class View2 extends Alias[Int] { def apply(xs: Int) = xs }
}