diff options
Diffstat (limited to 'src/reflect')
-rw-r--r-- | src/reflect/scala/reflect/api/Symbols.scala | 8 | ||||
-rw-r--r-- | src/reflect/scala/reflect/internal/Symbols.scala | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/reflect/scala/reflect/api/Symbols.scala b/src/reflect/scala/reflect/api/Symbols.scala index 562129d893..6fff965de1 100644 --- a/src/reflect/scala/reflect/api/Symbols.scala +++ b/src/reflect/scala/reflect/api/Symbols.scala @@ -824,6 +824,14 @@ trait Symbols { self: Universe => * @group Method */ def returnType: Type + + /** Exceptions that this method is known to throw. + * For Scala methods, the list is calculated from [[throws]] annotations present on a method. + * For Java methods, the list is calculated from `throws` clauses attached to the method and stored in bytecode. + * + * @group Method + */ + def exceptions: List[Symbol] } /** The API of module symbols. diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala index f2b3d52c6f..dae9eba878 100644 --- a/src/reflect/scala/reflect/internal/Symbols.scala +++ b/src/reflect/scala/reflect/internal/Symbols.scala @@ -2817,6 +2817,8 @@ trait Symbols extends api.Symbols { self: SymbolTable => } loop(info) } + + override def exceptions = annotations flatMap ThrownException.unapply } implicit val MethodSymbolTag = ClassTag[MethodSymbol](classOf[MethodSymbol]) |