summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-08-21 18:11:07 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-08-21 18:11:07 -0700
commitf315253ff7c5f4074f61a079308db45452be75db (patch)
tree65a77a76f335465a96fe71decb3d2b91f75c8b2c /src/library
parenta1aaab2673016d65c1919c37fe24417f2cb0cb91 (diff)
parent46f17f114bf261dc8757b5b876da50d53bb31172 (diff)
downloadscala-f315253ff7c5f4074f61a079308db45452be75db.tar.gz
scala-f315253ff7c5f4074f61a079308db45452be75db.tar.bz2
scala-f315253ff7c5f4074f61a079308db45452be75db.zip
Merge pull request #2810 from xeno-by/topic/compile-time-only
@compileTimeOnly: moved to scala-library.jar, got some fixes
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/annotation/compileTimeOnly.scala22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/library/scala/annotation/compileTimeOnly.scala b/src/library/scala/annotation/compileTimeOnly.scala
new file mode 100644
index 0000000000..942e9cad8c
--- /dev/null
+++ b/src/library/scala/annotation/compileTimeOnly.scala
@@ -0,0 +1,22 @@
+package scala.annotation
+
+import scala.annotation.meta._
+
+/**
+ * An annotation that designates that an annottee should not be referred to after
+ * type checking (which includes macro expansion).
+ *
+ * Examples of potential use:
+ * 1) The annottee can only appear in the arguments of some other macro
+ * that will eliminate it from the AST during expansion.
+ * 2) The annottee is a macro and should have been expanded away,
+ * so if hasn't, something wrong has happened.
+ * (Comes in handy to provide better support for new macro flavors,
+ * e.g. macro annotations, that can't be expanded by the vanilla compiler).
+ *
+ * @param message the error message to print during compilation if a reference remains
+ * after type checking
+ * @since 2.11.0
+ */
+@getter @setter @beanGetter @beanSetter @companionClass @companionMethod
+final class compileTimeOnly(message: String) extends scala.annotation.StaticAnnotation