aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/i1501.scala
blob: 68556640383af7a61e20f3c37a597532e5258787 (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
24
25
26
27
28
class A {
  def foo: Int = 1
}

trait B extends A

abstract class D {
  def foo: Int
}

class C extends D with B // error: illegal trait inheritance
trait E extends D with B // error: illegal trait inheritance

object Test {
  def main(args: Array[String]): Unit = {
    println(new C().foo)
  }
}

object Test2 {
  class A
  class SubA(x: Int) extends A
  trait TA extends A
  trait TSubA extends SubA(2) // error: trait TSubA may not call constructor of class SubA


  class Foo extends TA with TSubA // error: missing argument for parameter x of constructor SubA:
}