summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/settings/ScalaSettings.scala2
-rw-r--r--src/library/scala/annotation/elidable.scala4
-rw-r--r--test/files/run/elidable.check1
-rw-r--r--test/files/run/elidable.flags1
-rw-r--r--test/files/run/elidable.scala14
5 files changed, 19 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
index 84ede32504..4bc8e47bb4 100644
--- a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
+++ b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
@@ -55,7 +55,7 @@ trait ScalaSettings extends AbsScalaSettings with StandardScalaSettings {
val sourcedir = StringSetting ("-Xsourcedir", "directory", "When -target:msil, the source folder structure is mirrored in output directory.", ".").dependsOn(target, "msil")
val checkInit = BooleanSetting ("-Xcheckinit", "Add runtime checks on field accessors. Uninitialized accesses result in an exception being thrown.")
val noassertions = BooleanSetting ("-Xdisable-assertions", "Generate no assertions and assumptions")
- val elideLevel = IntSetting ("-Xelide-level", "Generate calls to @elidable-marked methods only method priority is greater than argument.",
+ val elideLevel = IntSetting ("-Xelide-below", "Generate calls to @elidable-marked methods only if method priority is greater than argument.",
elidable.ASSERTION, None, elidable.byName.get(_))
val Xexperimental = BooleanSetting ("-Xexperimental", "Enable experimental extensions")
val noForwarders = BooleanSetting ("-Xno-forwarders", "Do not generate static forwarders in mirror classes")
diff --git a/src/library/scala/annotation/elidable.scala b/src/library/scala/annotation/elidable.scala
index 44ac7f050e..c75299e9fd 100644
--- a/src/library/scala/annotation/elidable.scala
+++ b/src/library/scala/annotation/elidable.scala
@@ -13,7 +13,7 @@ import java.util.logging.Level
/** An annotation for methods for which invocations might
* be removed in the generated code.
*
- * Behavior is influenced by passing -Xelide-level <arg>
+ * Behavior is influenced by passing -Xelide-below <arg>
* to scalac. Methods marked elidable will be omitted from
* generated code if the priority given the annotation is lower
* than to the command line argument. Examples:
@@ -23,7 +23,7 @@ import java.util.logging.Level
* @elidable(WARNING) def foo = log("foo")
* @elidable(FINE) def bar = log("bar")
*
- * scalac -Xelide-methods-below=1000
+ * scalac -Xelide-below=1000
* }}}
* @since 2.8
*/
diff --git a/test/files/run/elidable.check b/test/files/run/elidable.check
new file mode 100644
index 0000000000..4ce04f0040
--- /dev/null
+++ b/test/files/run/elidable.check
@@ -0,0 +1 @@
+Good for me, I was not elided.
diff --git a/test/files/run/elidable.flags b/test/files/run/elidable.flags
new file mode 100644
index 0000000000..93fd3d5317
--- /dev/null
+++ b/test/files/run/elidable.flags
@@ -0,0 +1 @@
+-Xelide-below 900
diff --git a/test/files/run/elidable.scala b/test/files/run/elidable.scala
new file mode 100644
index 0000000000..e0ac2ed0db
--- /dev/null
+++ b/test/files/run/elidable.scala
@@ -0,0 +1,14 @@
+import annotation._
+import elidable._
+
+object Test {
+ @elidable(FINEST) def f1() = assert(false, "Should have been elided.")
+ @elidable(INFO) def f2() = assert(false, "Should have been elided.")
+ @elidable(SEVERE) def f3() = println("Good for me, I was not elided.")
+
+ def main(args: Array[String]): Unit = {
+ f1()
+ f2()
+ f3()
+ }
+}