summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2007-03-08 14:36:14 +0000
committerMartin Odersky <odersky@gmail.com>2007-03-08 14:36:14 +0000
commitb213b89017d3fc1998b8cebe18d4a80519df972e (patch)
treed0a4ffc8647693f18652cdb1657bcabfdaa78493
parenta0476f0882fd88137b9f539327dd5ee0fe76f933 (diff)
downloadscala-b213b89017d3fc1998b8cebe18d4a80519df972e.tar.gz
scala-b213b89017d3fc1998b8cebe18d4a80519df972e.tar.bz2
scala-b213b89017d3fc1998b8cebe18d4a80519df972e.zip
added unchecked.scala
-rw-r--r--src/library/scala/unchecked.scala43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/library/scala/unchecked.scala b/src/library/scala/unchecked.scala
new file mode 100644
index 0000000000..488f1e4133
--- /dev/null
+++ b/src/library/scala/unchecked.scala
@@ -0,0 +1,43 @@
+/* __ *\
+** ________ ___ / / ___ Scala API **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
+** /____/\___/_/ |_/____/_/ | | **
+** |/ **
+\* */
+
+// $Id: unsealed.scala 10201 2007-03-04 10:53:12 +0000 (Sun, 04 Mar 2007) mihaylov $
+
+
+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><pre>
+ * <b>object</b> test <b>extends</b> Application {
+ * <b>def</b> f(x: Option[int]) = x <b>match</b> {
+ * <b>case</b> Some(y) => y
+ * }
+ * f(None)
+ * }</pre>
+ * <p>
+ * will display the following warning:
+ * </p><pre>
+ * 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</code> with <code>(x: @unchecked)</code>. Then the
+ * modified code will compile silently, but, in any case, a
+ * <a href="MatchError.html"><code>MatchError</code></a>
+ * will be raised at runtime.
+ * </p>
+ */
+class unchecked extends Annotation {}