@@ -11,7 +11,7 @@ import scala.collection.mutable
1111import dotty .tools .dotc .CompilationUnit
1212import dotty .tools .dotc .ast .tpd
1313import dotty .tools .dotc .ast .Trees
14- import dotty .tools .dotc .core .Annotations .Annotation
14+ import dotty .tools .dotc .core .Annotations ._
1515import dotty .tools .dotc .core .Constants ._
1616import dotty .tools .dotc .core .Contexts .Context
1717import dotty .tools .dotc .core .Decorators ._
@@ -368,14 +368,12 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
368368 case StringTag =>
369369 assert(const.value != null , const) // TODO this invariant isn't documented in `case class Constant`
370370 av.visit(name, const.stringValue) // `stringValue` special-cases null, but that execution path isn't exercised for a const with StringTag
371- case ClazzTag => av.visit(name, typeToTypeKind(const.typeValue)(bcodeStore)(innerClasesStore).toASMType)
371+ case ClazzTag => av.visit(name, typeToTypeKind(TypeErasure .erasure( const.typeValue) )(bcodeStore)(innerClasesStore).toASMType)
372372 case EnumTag =>
373373 val edesc = innerClasesStore.typeDescriptor(const.tpe) // the class descriptor of the enumeration class.
374374 val evalue = const.symbolValue.javaSimpleName // value the actual enumeration value.
375375 av.visitEnum(name, edesc, evalue)
376376 }
377- case t : TypeApply if (t.fun.symbol == defn.Predef_classOf ) =>
378- av.visit(name, typeToTypeKind(t.args.head.tpe.classSymbol.denot.info)(bcodeStore)(innerClasesStore).toASMType)
379377 case Ident (nme.WILDCARD ) =>
380378 // An underscore argument indicates that we want to use the default value for this parameter, so do not emit anything
381379 case t : tpd.RefTree if t.symbol.denot.owner.isAllOf(JavaEnumTrait ) =>
@@ -514,7 +512,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
514512
515513 // TODO needed? for(ann <- m.annotations) { ann.symbol.initialize }
516514 val jgensig = getStaticForwarderGenericSignature(m, module)
517- val (throws, others) = m.annotations partition (_.tree. symbol == defn.ThrowsAnnot )
515+ val (throws, others) = m.annotations. partition(_.symbol eq defn.ThrowsAnnot )
518516 val thrownExceptions : List [String ] = getExceptions(throws)
519517
520518 val jReturnType = toTypeKind(methodInfo.resultType)
@@ -614,12 +612,9 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
614612 * must-single-thread
615613 */
616614 def getExceptions (excs : List [Annotation ]): List [String ] = {
617- // TODO: implement ThrownException
618- // for (ThrownException(exc) <- excs.distinct)
619- // yield internalName(exc)
620- Nil
615+ for (case ThrownException (exc) <- excs.distinct)
616+ yield internalName(TypeErasure .erasure(exc).classSymbol)
621617 }
622-
623618 } // end of trait BCForwardersGen
624619
625620 trait BCClassGen extends BCInnerClassGen {
0 commit comments