diff options
author | Martin Odersky <odersky@gmail.com> | 2014-08-03 20:50:37 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-08-03 21:02:11 +0200 |
commit | e25232d5b4fdc1ae7bc5a44ad06e31a00699dbaf (patch) | |
tree | 26c3ce90d09933debc6a991d10e708cc65a84157 /src/dotty/tools/dotc/core/SymDenotations.scala | |
parent | 168e4f18f0b2f8ac0e3d7ef5128797303dec6a44 (diff) | |
download | dotty-e25232d5b4fdc1ae7bc5a44ad06e31a00699dbaf.tar.gz dotty-e25232d5b4fdc1ae7bc5a44ad06e31a00699dbaf.tar.bz2 dotty-e25232d5b4fdc1ae7bc5a44ad06e31a00699dbaf.zip |
Annotation decorators for symbols
Added decorators for symbols that can query specific
annotations and annotation arguments (for now, -deprecated
and -migration are added)
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index 91a8e4345..fcc01503f 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -200,14 +200,9 @@ object SymDenotations { dropOtherAnnotations(annotations, cls).nonEmpty /** Optionally, the arguments of the first annotation matching the given class symbol */ - final def getAnnotationArgs(cls: Symbol)(implicit ctx: Context): Option[List[tpd.Tree]] = + final def getAnnotation(cls: Symbol)(implicit ctx: Context): Option[Annotation] = dropOtherAnnotations(annotations, cls) match { - case annot :: _ => - Some( - annot.tree match { - case Trees.Apply(_, args) => args - case _ => Nil - }) + case annot :: _ => Some(annot) case nil => None } |