summaryrefslogtreecommitdiff
path: root/test/files/neg/elide-to-nothing.scala
blob: 5008e8bc1df427b0d1c7390fe18a13a862854b06 (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
/** Test which should fail compilation */
class ElysianFailed {

  import ElysianField._

  // fine
  val a: Int = myInt

  // fine
  unimplemented()

  // not fine
  val b: Nothing = unimplemented()
  
}

object ElysianField {

  import annotation.elidable

  @elidable(100) def unimplemented(): Nothing = throw new UnsupportedOperationException

  @elidable(100) def myInt: Int = 17

}