diff options
author | Paul Phillips <paulp@improving.org> | 2010-03-23 16:52:51 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-03-23 16:52:51 +0000 |
commit | 26a2abff274fb7facfadcf5e9b66d805a1b670b1 (patch) | |
tree | 14a800206ce137e9e1e7fd3e6fbf4aeb8703d307 | |
parent | 011377a2c73aee41673544479ee5db85fe143917 (diff) | |
download | scala-26a2abff274fb7facfadcf5e9b66d805a1b670b1.tar.gz scala-26a2abff274fb7facfadcf5e9b66d805a1b670b1.tar.bz2 scala-26a2abff274fb7facfadcf5e9b66d805a1b670b1.zip |
Although it was working fine, a test case for @...
Although it was working fine, a test case for @elidable to make sure
that state of affairs continues. No review.
-rw-r--r-- | src/compiler/scala/tools/nsc/settings/ScalaSettings.scala | 2 | ||||
-rw-r--r-- | src/library/scala/annotation/elidable.scala | 4 | ||||
-rw-r--r-- | test/files/run/elidable.check | 1 | ||||
-rw-r--r-- | test/files/run/elidable.flags | 1 | ||||
-rw-r--r-- | test/files/run/elidable.scala | 14 |
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() + } +} |