diff options
author | Martin Odersky <odersky@gmail.com> | 2012-04-11 16:13:09 -0700 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2012-04-11 16:13:09 -0700 |
commit | 699bb5886ec9e73d7c90be1a280e7420d30e6e9b (patch) | |
tree | df0132cf34731c46730fa058c417d89e5986fe74 /src/library | |
parent | b448f13d431a1a4e9d23c6acbf4bd15ccb647e3f (diff) | |
download | scala-699bb5886ec9e73d7c90be1a280e7420d30e6e9b.tar.gz scala-699bb5886ec9e73d7c90be1a280e7420d30e6e9b.tar.bz2 scala-699bb5886ec9e73d7c90be1a280e7420d30e6e9b.zip |
new annotation targets for companion classes/objects/factory methods.
Diffstat (limited to 'src/library')
3 files changed, 48 insertions, 0 deletions
diff --git a/src/library/scala/annotation/meta/companionClass.scala b/src/library/scala/annotation/meta/companionClass.scala new file mode 100644 index 0000000000..8e53f6caf9 --- /dev/null +++ b/src/library/scala/annotation/meta/companionClass.scala @@ -0,0 +1,17 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2002-2011, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ +package scala.annotation.meta + +/** + * When defining an implicit class, the Scala compiler creates an implicit + * conversion method for it. Annotations `@companionClass` and `@companionMethod` + * control where an annotation on the implicit class will go. By default, annotations + * on an implicit class end up only on the class. + * + */ +final class companionClass extends annotation.StaticAnnotation diff --git a/src/library/scala/annotation/meta/companionMethod.scala b/src/library/scala/annotation/meta/companionMethod.scala new file mode 100644 index 0000000000..379c4f3385 --- /dev/null +++ b/src/library/scala/annotation/meta/companionMethod.scala @@ -0,0 +1,17 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2002-2011, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ +package scala.annotation.meta + +/** + * When defining an implicit class, the Scala compiler creates an implicit + * conversion method for it. Annotations `@companionClass` and `@companionMethod` + * control where an annotation on the implicit class will go. By default, annotations + * on an implicit class end up only on the class. + * + */ +final class companionMethod extends annotation.StaticAnnotation diff --git a/src/library/scala/annotation/meta/companionObject.scala b/src/library/scala/annotation/meta/companionObject.scala new file mode 100644 index 0000000000..d329df5c42 --- /dev/null +++ b/src/library/scala/annotation/meta/companionObject.scala @@ -0,0 +1,14 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2002-2011, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ +package scala.annotation.meta + +/** + * Currently unused; intended as an annotation target for classes such as case classes + * that automatically generate a companion object + */ +final class companionObject extends annotation.StaticAnnotation |