aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/instantiateAbstract.scala
blob: 1e119a8b57e2c138abd8eb8e160e45ada1242337 (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
29
30
31
32
33
34
35
36
37
38
abstract class AA

trait TT

class A { self: B =>

}

@scala.annotation.Annotation class C // error

class B extends A() {
}

object Test {

  @scala.annotation.Annotation type T = String // error
  @scala.annotation.Annotation val x = 1 // error
  @scala.annotation.Annotation def f = 1 //error

  (1: @scala.annotation.Annotation) // error


  new AA // error

  new TT // error

  new A // error

// the following are OK in Typer but would be caught later in RefChecks

  new A() {}

  new AA() {}

  object O extends A

  object OO extends AA
}