summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorSimon Ochsenreither <simon@ochsenreither.de>2012-07-31 01:02:07 +0200
committerJason Zaugg <jzaugg@gmail.com>2012-09-10 22:57:21 +0200
commite3b0c7abbf637dacce7bcd7b69d5655820e8e714 (patch)
tree392819cf24113b893c1622b5ecc80605bd34b3d6 /src/library
parentadf2d3632b07eef4fc2303aef994e66584a73f49 (diff)
downloadscala-e3b0c7abbf637dacce7bcd7b69d5655820e8e714.tar.gz
scala-e3b0c7abbf637dacce7bcd7b69d5655820e8e714.tar.bz2
scala-e3b0c7abbf637dacce7bcd7b69d5655820e8e714.zip
SI-6162 Adds @deprecatedInheritance/@deprecatedOverriding
These annotations are meant to warn from inheriting a class or from overriding a member, due to the reasons given in `msg`. The naming and placement of the methods is in line with @deprecated and @deprecatedName.
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/deprecatedInheritance.scala20
-rw-r--r--src/library/scala/deprecatedOverriding.scala19
2 files changed, 39 insertions, 0 deletions
diff --git a/src/library/scala/deprecatedInheritance.scala b/src/library/scala/deprecatedInheritance.scala
new file mode 100644
index 0000000000..c461f6737c
--- /dev/null
+++ b/src/library/scala/deprecatedInheritance.scala
@@ -0,0 +1,20 @@
+/* __ *\
+** ________ ___ / / ___ Scala API **
+** / __/ __// _ | / / / _ | (c) 2012, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
+** /____/\___/_/ |_/____/_/ | | **
+** |/ **
+\* */
+
+package scala
+
+/** An annotation that designates that inheriting from a class is deprecated.
+ *
+ * This is usually done to warn about a non-final class being made final in a future version.
+ * Sub-classing such a class then generates a warning.
+ *
+ * @param message the message to print during compilation if the class was sub-classed
+ * @param since a string identifying the first version in which inheritance was deprecated
+ * @since 2.10
+ */
+class deprecatedInheritance(message: String = "", since: String = "") extends annotation.StaticAnnotation \ No newline at end of file
diff --git a/src/library/scala/deprecatedOverriding.scala b/src/library/scala/deprecatedOverriding.scala
new file mode 100644
index 0000000000..9048d5d32d
--- /dev/null
+++ b/src/library/scala/deprecatedOverriding.scala
@@ -0,0 +1,19 @@
+/* __ *\
+** ________ ___ / / ___ Scala API **
+** / __/ __// _ | / / / _ | (c) 2012, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
+** /____/\___/_/ |_/____/_/ | | **
+** |/ **
+\* */
+
+package scala
+
+/** An annotation that designates that overriding a member is deprecated.
+ *
+ * Overriding such a member in a sub-class then generates a warning.
+ *
+ * @param message the message to print during compilation if the member was overridden
+ * @param since a string identifying the first version in which overriding was deprecated
+ * @since 2.10
+ */
+class deprecatedOverriding(message: String = "", since: String = "") extends annotation.StaticAnnotation \ No newline at end of file