summaryrefslogtreecommitdiff
path: root/src/reflect/scala/reflect/api/Symbols.scala
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2014-01-28 10:27:59 +0300
committerEugene Burmako <xeno.by@gmail.com>2014-02-14 13:24:48 +0100
commitedadc01df2cbac2c8a00c2e0cc520713690418b9 (patch)
tree5a7211dca95674f85460ee52f167766f0df9348c /src/reflect/scala/reflect/api/Symbols.scala
parentad7983b70a43ba9033a491c00ad22691e7a0a7b4 (diff)
downloadscala-edadc01df2cbac2c8a00c2e0cc520713690418b9.tar.gz
scala-edadc01df2cbac2c8a00c2e0cc520713690418b9.tar.bz2
scala-edadc01df2cbac2c8a00c2e0cc520713690418b9.zip
SI-6379 adds MethodSymbol.exception
Following Simon’s request, this commit introduces a dedicated API that can be used to acquire the list of exceptions thrown by a method, abstracting away from whether it’s a Java or a Scala artifact.
Diffstat (limited to 'src/reflect/scala/reflect/api/Symbols.scala')
-rw-r--r--src/reflect/scala/reflect/api/Symbols.scala8
1 files changed, 8 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.