summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2013-01-31 20:40:16 +0100
committerEugene Burmako <xeno.by@gmail.com>2013-02-01 16:55:40 +0100
commitf1701f704a2485fcc2eb6d5d8b5d0228beddd9b3 (patch)
tree1ed30237e997bfcd76f7f595adaab4e21dcfaecb /src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
parent309ff57ba62b6a6ec1a9c1b28b8bbabfd1b47b72 (diff)
downloadscala-f1701f704a2485fcc2eb6d5d8b5d0228beddd9b3.tar.gz
scala-f1701f704a2485fcc2eb6d5d8b5d0228beddd9b3.tar.bz2
scala-f1701f704a2485fcc2eb6d5d8b5d0228beddd9b3.zip
SI-7008 @throws annotations are now populated in reflect
Runtime reflection in JavaMirrors previously forgot to fill in @throws when importing Java reflection artifacts. Now this is fixed. Note that generic exception types used in `throws` specifications will be garbled (i.e. erased), because we don't use `getGenericExceptionTypes` in favor of just `getExceptionTypes` to stay compatible with the behavior of ClassfileParser. That's a bug, but a separate one and should be fixed separately. Also note that this commit updated javac-artifacts.jar, because we need to test how reflection works with javac-produced classfiles. The sources that were used to produce those classfiles can be found in the jar next to the classfiles.
Diffstat (limited to 'src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
index 4b1d3c34f3..7ac7b4d637 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
@@ -1043,13 +1043,7 @@ abstract class ClassfileParser {
val nClasses = in.nextChar
for (n <- 0 until nClasses) {
val cls = pool.getClassSymbol(in.nextChar.toInt)
- val tp = if (cls.isMonomorphicType) cls.tpe else {
- debuglog(s"Encountered polymorphic exception `${cls.fullName}` while parsing class file.")
- // in case we encounter polymorphic exception the best we can do is to convert that type to
- // monomorphic one by introducing existientals, see SI-7009 for details
- typer.packSymbols(cls.typeParams, cls.tpe)
- }
- sym.addAnnotation(appliedType(definitions.ThrowsClass, tp), Literal(Constant(tp)))
+ sym.addThrowsAnnotation(cls)
}
}