diff options
Diffstat (limited to 'src/compiler/scala/tools/nsc/symtab/Symbols.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Symbols.scala | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Symbols.scala b/src/compiler/scala/tools/nsc/symtab/Symbols.scala index 8e72674dd7..eb3313a71c 100644 --- a/src/compiler/scala/tools/nsc/symtab/Symbols.scala +++ b/src/compiler/scala/tools/nsc/symtab/Symbols.scala @@ -412,10 +412,12 @@ trait Symbols { def isDeprecated = hasAnnotation(DeprecatedAttr) def deprecationMessage: Option[String] = annotations find (_.atp.typeSymbol == DeprecatedAttr) flatMap { annot => - if (annot.args.length == 1) - annot.args.head.constant map { c => c.stringValue } - else - None + annot.args match { + case Literal(const) :: Nil => + Some(const.stringValue) + case _ => + None + } } /** Does this symbol denote a wrapper object of the interpreter or its class? */ |