alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (unchecked.scala)

This example Scala source code file (unchecked.scala) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Scala tags/keywords

The Scala unchecked.scala source code

/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2002-2011, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |    http://scala-lang.org/               **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */



package scala

/** <p>
 *    An annotation that gets applied to a selector in a match expression.
 *    If it is present, exhaustiveness warnings for that expression will be
 *    suppressed.
 *  </p>
 *  <p>
 *    For example, compiling the code:
 *  </p>
 *    <b>object test extends Application {
 *      <b>def f(x: Option[int]) = x match {
 *        <b>case Some(y) => y
 *      }
 *      f(None)
 *    }</pre>
 *  <p>
 *    will display the following warning:
 *  </p>
 *    test.scala:2: warning: does not cover case {object None}
 *      def f(x: Option[int]) = x match {
 *                              ^
 *    one warning found</pre>
 *  <p>
 *    The above message may be suppressed by substituting the expression
 *    <code>x with (x: @unchecked). Then the
 *    modified code will compile silently, but, in any case, a
 *    <a href="MatchError.html">MatchError
 *    will be raised at runtime.
 *  </p>
 *
 *  @since 2.4
 */
class unchecked extends annotation.Annotation {}

Other Scala examples (source code examples)

Here is a short list of links related to this Scala unchecked.scala source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.