scala

unchecked

class unchecked extends Annotation

An annotation that gets applied to a selector in a match expression. If it is present, exhaustiveness warnings for that expression will be suppressed. For example, compiling the code:

   object test extends App {
     def f(x: Option[Int]) = x match {
       case Some(y) => y
     }
     f(None)
   }

will display the following warning:

   test.scala:2: warning: does not cover case {object None}
     def f(x: Option[int]) = x match {
                             ^
   one warning found

The above message may be suppressed by substituting the expression x with (x: @unchecked). Then the modified code will compile silently, but, in any case, a MatchError will be raised at runtime.

Source
unchecked.scala
Since

2.4

Linear Supertypes
Annotation, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. unchecked
  2. Annotation
  3. AnyRef
  4. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new unchecked()